]> git.mxchange.org Git - friendica.git/blobdiff - library/perfect-scrollbar/perfect-scrollbar.jquery.js
Merge remote-tracking branch 'upstream/develop' into 1606-contact-priority
[friendica.git] / library / perfect-scrollbar / perfect-scrollbar.jquery.js
index 2bc3b2f939e7016f1634e39dc67b6d7c13b61257..d94ed91bcd0abe4dfaff7c03ba8454544951153d 100644 (file)
@@ -1,10 +1,12 @@
-/* perfect-scrollbar v0.6.8 */
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
+/* perfect-scrollbar v0.6.10
+ * 
+ * Copyright (c) 2015 Hyunje Alex Jun and other contributors
  * Licensed under the MIT License
  * 
  * Source: https://github.com/noraesae/perfect-scrollbar
  */
+
+(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
 'use strict';
 
 var ps = require('../main')
@@ -50,9 +52,6 @@ if (typeof define === 'function' && define.amd) {
 module.exports = mountJQuery;
 
 },{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 function oldAdd(element, className) {
@@ -97,9 +96,6 @@ exports.list = function (element) {
 };
 
 },{}],3:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var DOM = {};
@@ -186,9 +182,6 @@ DOM.queryChildren = function (element, selector) {
 module.exports = DOM;
 
 },{}],4:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var EventElement = function (element) {
@@ -262,9 +255,6 @@ EventManager.prototype.once = function (element, eventName, handler) {
 module.exports = EventManager;
 
 },{}],5:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 module.exports = (function () {
@@ -280,9 +270,6 @@ module.exports = (function () {
 })();
 
 },{}],6:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var cls = require('./class')
@@ -366,9 +353,6 @@ exports.env = {
 };
 
 },{"./class":2,"./dom":3}],7:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var destroy = require('./plugin/destroy')
@@ -382,9 +366,6 @@ module.exports = {
 };
 
 },{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 module.exports = {
@@ -400,13 +381,11 @@ module.exports = {
   useKeyboard: true,
   useSelectionScroll: false,
   wheelPropagation: false,
-  wheelSpeed: 1
+  wheelSpeed: 1,
+  theme: 'default'
 };
 
 },{}],9:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var d = require('../lib/dom')
@@ -431,9 +410,6 @@ module.exports = function (element) {
 };
 
 },{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var h = require('../../lib/helper')
@@ -496,9 +472,6 @@ module.exports = function (element) {
 };
 
 },{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var d = require('../../lib/dom')
@@ -604,12 +577,10 @@ module.exports = function (element) {
 };
 
 },{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var h = require('../../lib/helper')
+  , d = require('../../lib/dom')
   , instances = require('../instances')
   , updateGeometry = require('../update-geometry')
   , updateScroll = require('../update-scroll');
@@ -652,7 +623,10 @@ function bindKeyboardHandler(element, i) {
       return;
     }
 
-    if (!hovered) {
+    var focused = d.matches(i.scrollbarX, ':focus') ||
+                  d.matches(i.scrollbarY, ':focus');
+
+    if (!hovered && !focused) {
       return;
     }
 
@@ -730,10 +704,7 @@ module.exports = function (element) {
   bindKeyboardHandler(element, i);
 };
 
-},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
+},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
 'use strict';
 
 var instances = require('../instances')
@@ -870,9 +841,6 @@ module.exports = function (element) {
 };
 
 },{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var instances = require('../instances')
@@ -890,9 +858,6 @@ module.exports = function (element) {
 };
 
 },{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var h = require('../../lib/helper')
@@ -1004,9 +969,6 @@ module.exports = function (element) {
 };
 
 },{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var instances = require('../instances')
@@ -1177,9 +1139,6 @@ module.exports = function (element, supportsTouch, supportsIePointer) {
 };
 
 },{"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var cls = require('../lib/class')
@@ -1205,6 +1164,7 @@ module.exports = function (element, userSettings) {
   var i = instances.add(element);
 
   i.settings = h.extend(i.settings, userSettings);
+  cls.add(element, 'ps-theme-' + i.settings.theme);
 
   clickRailHandler(element);
   dragScrollbarHandler(element);
@@ -1226,12 +1186,10 @@ module.exports = function (element, userSettings) {
 };
 
 },{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
-var d = require('../lib/dom')
+var cls = require('../lib/class')
+  , d = require('../lib/dom')
   , defaultSettings = require('./default-setting')
   , EventManager = require('../lib/event-manager')
   , guid = require('../lib/guid')
@@ -1261,9 +1219,19 @@ function Instance(element) {
   i.event = new EventManager();
   i.ownerDocument = element.ownerDocument || document;
 
+  function focus() {
+    cls.add(element, 'ps-focus');
+  }
+
+  function blur() {
+    cls.remove(element, 'ps-focus');
+  }
+
   i.scrollbarXRail = d.appendTo(d.e('div', 'ps-scrollbar-x-rail'), element);
   i.scrollbarX = d.appendTo(d.e('div', 'ps-scrollbar-x'), i.scrollbarXRail);
   i.scrollbarX.setAttribute('tabindex', 0);
+  i.event.bind(i.scrollbarX, 'focus', focus);
+  i.event.bind(i.scrollbarX, 'blur', blur);
   i.scrollbarXActive = null;
   i.scrollbarXWidth = null;
   i.scrollbarXLeft = null;
@@ -1281,6 +1249,8 @@ function Instance(element) {
   i.scrollbarYRail = d.appendTo(d.e('div', 'ps-scrollbar-y-rail'), element);
   i.scrollbarY = d.appendTo(d.e('div', 'ps-scrollbar-y'), i.scrollbarYRail);
   i.scrollbarY.setAttribute('tabindex', 0);
+  i.event.bind(i.scrollbarY, 'focus', focus);
+  i.event.bind(i.scrollbarY, 'blur', blur);
   i.scrollbarYActive = null;
   i.scrollbarYHeight = null;
   i.scrollbarYTop = null;
@@ -1336,10 +1306,7 @@ exports.get = function (element) {
   return instances[getId(element)];
 };
 
-},{"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
+},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
 'use strict';
 
 var cls = require('../lib/class')
@@ -1468,9 +1435,6 @@ module.exports = function (element) {
 };
 
 },{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var instances = require('./instances');
@@ -1513,29 +1477,25 @@ module.exports = function (element, axis, value) {
   }
 
   if (axis === 'top' && value <= 0) {
-    element.scrollTop = 0;
+    element.scrollTop = value = 0; // don't allow negative scroll
     element.dispatchEvent(yStartEvent);
-    return; // don't allow negative scroll
   }
 
   if (axis === 'left' && value <= 0) {
-    element.scrollLeft = 0;
+    element.scrollLeft = value = 0; // don't allow negative scroll
     element.dispatchEvent(xStartEvent);
-    return; // don't allow negative scroll
   }
 
   var i = instances.get(element);
 
   if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
-    element.scrollTop = i.contentHeight - i.containerHeight;
+    element.scrollTop = value = i.contentHeight - i.containerHeight; // don't allow scroll past container
     element.dispatchEvent(yEndEvent);
-    return; // don't allow scroll past container
   }
 
   if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
-    element.scrollLeft = i.contentWidth - i.containerWidth;
+    element.scrollLeft = value = i.contentWidth - i.containerWidth; // don't allow scroll past container
     element.dispatchEvent(xEndEvent);
-    return; // don't allow scroll past container
   }
 
   if (!lastTop) {
@@ -1575,9 +1535,6 @@ module.exports = function (element, axis, value) {
 };
 
 },{"./instances":18}],21:[function(require,module,exports){
-/* Copyright (c) 2015 Hyunje Alex Jun and other contributors
- * Licensed under the MIT License
- */
 'use strict';
 
 var d = require('../lib/dom')