perfect-scrollbar-rails 0.6.8.1 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bcf5dc1ecb75ad7d7a02bc79fa4a6af4ade826ff
4
- data.tar.gz: 035d617278a7553d8886dd27b48c1ef2f5f3e331
3
+ metadata.gz: 3c58aa83e150a0b98948ff642ffae0e1300409cc
4
+ data.tar.gz: 0574f1ec2f7110eac97624c640cb1fc3cf4c1b3d
5
5
  SHA512:
6
- metadata.gz: 32f729fb4352ab14706a3c68da545b6f0e790b8fefd7046b34b7822fec5fbd8d4c178f5a944a1973c659c938f79b7f98cdb0525cc92650f1b6f4af5eea7241e5
7
- data.tar.gz: 5232e97350540e03620bcf2113fd1824ebe34a8c1044d3148675b65b823ff8a8565bd7711b1b8221a0abfee1376723a36adce178cf1ebf483c511cfa7f1d952b
6
+ metadata.gz: 031cb6f9e3c92b306c5abf65704510452a760332488184845bce8165345db55ceb727cc5187b831b7a1a81d2396be794a9ac60a3986f55adec5fb215f21010a5
7
+ data.tar.gz: 5e9a7cd1d09635622a96a1b84f19d6c4694b874073ad9a3a910fd8c09671875257a52ef9fcb38ad40d2a14060937afca326bcf1472e58a930235adf46252a087
@@ -1,5 +1,5 @@
1
1
  module PerfectScrollbar
2
2
  module Rails
3
- VERSION = '0.6.8.1'
3
+ VERSION = '0.6.9'
4
4
  end
5
5
  end
@@ -1,8 +1,5 @@
1
- /* perfect-scrollbar v0.6.8 */
1
+ /* perfect-scrollbar v0.6.9 */
2
2
  (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){
3
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
4
- * Licensed under the MIT License
5
- */
6
3
  'use strict';
7
4
 
8
5
  var ps = require('../main')
@@ -48,9 +45,6 @@ if (typeof define === 'function' && define.amd) {
48
45
  module.exports = mountJQuery;
49
46
 
50
47
  },{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){
51
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
52
- * Licensed under the MIT License
53
- */
54
48
  'use strict';
55
49
 
56
50
  function oldAdd(element, className) {
@@ -95,9 +89,6 @@ exports.list = function (element) {
95
89
  };
96
90
 
97
91
  },{}],3:[function(require,module,exports){
98
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
99
- * Licensed under the MIT License
100
- */
101
92
  'use strict';
102
93
 
103
94
  var DOM = {};
@@ -184,9 +175,6 @@ DOM.queryChildren = function (element, selector) {
184
175
  module.exports = DOM;
185
176
 
186
177
  },{}],4:[function(require,module,exports){
187
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
188
- * Licensed under the MIT License
189
- */
190
178
  'use strict';
191
179
 
192
180
  var EventElement = function (element) {
@@ -260,9 +248,6 @@ EventManager.prototype.once = function (element, eventName, handler) {
260
248
  module.exports = EventManager;
261
249
 
262
250
  },{}],5:[function(require,module,exports){
263
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
264
- * Licensed under the MIT License
265
- */
266
251
  'use strict';
267
252
 
268
253
  module.exports = (function () {
@@ -278,9 +263,6 @@ module.exports = (function () {
278
263
  })();
279
264
 
280
265
  },{}],6:[function(require,module,exports){
281
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
282
- * Licensed under the MIT License
283
- */
284
266
  'use strict';
285
267
 
286
268
  var cls = require('./class')
@@ -364,9 +346,6 @@ exports.env = {
364
346
  };
365
347
 
366
348
  },{"./class":2,"./dom":3}],7:[function(require,module,exports){
367
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
368
- * Licensed under the MIT License
369
- */
370
349
  'use strict';
371
350
 
372
351
  var destroy = require('./plugin/destroy')
@@ -380,9 +359,6 @@ module.exports = {
380
359
  };
381
360
 
382
361
  },{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(require,module,exports){
383
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
384
- * Licensed under the MIT License
385
- */
386
362
  'use strict';
387
363
 
388
364
  module.exports = {
@@ -398,13 +374,11 @@ module.exports = {
398
374
  useKeyboard: true,
399
375
  useSelectionScroll: false,
400
376
  wheelPropagation: false,
401
- wheelSpeed: 1
377
+ wheelSpeed: 1,
378
+ theme: 'default'
402
379
  };
403
380
 
404
381
  },{}],9:[function(require,module,exports){
405
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
406
- * Licensed under the MIT License
407
- */
408
382
  'use strict';
409
383
 
410
384
  var d = require('../lib/dom')
@@ -429,9 +403,6 @@ module.exports = function (element) {
429
403
  };
430
404
 
431
405
  },{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){
432
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
433
- * Licensed under the MIT License
434
- */
435
406
  'use strict';
436
407
 
437
408
  var h = require('../../lib/helper')
@@ -494,9 +465,6 @@ module.exports = function (element) {
494
465
  };
495
466
 
496
467
  },{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){
497
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
498
- * Licensed under the MIT License
499
- */
500
468
  'use strict';
501
469
 
502
470
  var d = require('../../lib/dom')
@@ -602,12 +570,10 @@ module.exports = function (element) {
602
570
  };
603
571
 
604
572
  },{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){
605
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
606
- * Licensed under the MIT License
607
- */
608
573
  'use strict';
609
574
 
610
575
  var h = require('../../lib/helper')
576
+ , d = require('../../lib/dom')
611
577
  , instances = require('../instances')
612
578
  , updateGeometry = require('../update-geometry')
613
579
  , updateScroll = require('../update-scroll');
@@ -650,7 +616,10 @@ function bindKeyboardHandler(element, i) {
650
616
  return;
651
617
  }
652
618
 
653
- if (!hovered) {
619
+ var focused = d.matches(i.scrollbarX, ':focus') ||
620
+ d.matches(i.scrollbarY, ':focus');
621
+
622
+ if (!hovered && !focused) {
654
623
  return;
655
624
  }
656
625
 
@@ -728,10 +697,7 @@ module.exports = function (element) {
728
697
  bindKeyboardHandler(element, i);
729
698
  };
730
699
 
731
- },{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
732
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
733
- * Licensed under the MIT License
734
- */
700
+ },{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
735
701
  'use strict';
736
702
 
737
703
  var instances = require('../instances')
@@ -868,9 +834,6 @@ module.exports = function (element) {
868
834
  };
869
835
 
870
836
  },{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){
871
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
872
- * Licensed under the MIT License
873
- */
874
837
  'use strict';
875
838
 
876
839
  var instances = require('../instances')
@@ -888,9 +851,6 @@ module.exports = function (element) {
888
851
  };
889
852
 
890
853
  },{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){
891
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
892
- * Licensed under the MIT License
893
- */
894
854
  'use strict';
895
855
 
896
856
  var h = require('../../lib/helper')
@@ -1002,9 +962,6 @@ module.exports = function (element) {
1002
962
  };
1003
963
 
1004
964
  },{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){
1005
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
1006
- * Licensed under the MIT License
1007
- */
1008
965
  'use strict';
1009
966
 
1010
967
  var instances = require('../instances')
@@ -1175,9 +1132,6 @@ module.exports = function (element, supportsTouch, supportsIePointer) {
1175
1132
  };
1176
1133
 
1177
1134
  },{"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){
1178
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
1179
- * Licensed under the MIT License
1180
- */
1181
1135
  'use strict';
1182
1136
 
1183
1137
  var cls = require('../lib/class')
@@ -1203,6 +1157,7 @@ module.exports = function (element, userSettings) {
1203
1157
  var i = instances.add(element);
1204
1158
 
1205
1159
  i.settings = h.extend(i.settings, userSettings);
1160
+ cls.add(element, 'ps-theme-' + i.settings.theme);
1206
1161
 
1207
1162
  clickRailHandler(element);
1208
1163
  dragScrollbarHandler(element);
@@ -1224,12 +1179,10 @@ module.exports = function (element, userSettings) {
1224
1179
  };
1225
1180
 
1226
1181
  },{"../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){
1227
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
1228
- * Licensed under the MIT License
1229
- */
1230
1182
  'use strict';
1231
1183
 
1232
- var d = require('../lib/dom')
1184
+ var cls = require('../lib/class')
1185
+ , d = require('../lib/dom')
1233
1186
  , defaultSettings = require('./default-setting')
1234
1187
  , EventManager = require('../lib/event-manager')
1235
1188
  , guid = require('../lib/guid')
@@ -1259,9 +1212,19 @@ function Instance(element) {
1259
1212
  i.event = new EventManager();
1260
1213
  i.ownerDocument = element.ownerDocument || document;
1261
1214
 
1215
+ function focus() {
1216
+ cls.add(element, 'ps-focus');
1217
+ }
1218
+
1219
+ function blur() {
1220
+ cls.remove(element, 'ps-focus');
1221
+ }
1222
+
1262
1223
  i.scrollbarXRail = d.appendTo(d.e('div', 'ps-scrollbar-x-rail'), element);
1263
1224
  i.scrollbarX = d.appendTo(d.e('div', 'ps-scrollbar-x'), i.scrollbarXRail);
1264
1225
  i.scrollbarX.setAttribute('tabindex', 0);
1226
+ i.event.bind(i.scrollbarX, 'focus', focus);
1227
+ i.event.bind(i.scrollbarX, 'blur', blur);
1265
1228
  i.scrollbarXActive = null;
1266
1229
  i.scrollbarXWidth = null;
1267
1230
  i.scrollbarXLeft = null;
@@ -1279,6 +1242,8 @@ function Instance(element) {
1279
1242
  i.scrollbarYRail = d.appendTo(d.e('div', 'ps-scrollbar-y-rail'), element);
1280
1243
  i.scrollbarY = d.appendTo(d.e('div', 'ps-scrollbar-y'), i.scrollbarYRail);
1281
1244
  i.scrollbarY.setAttribute('tabindex', 0);
1245
+ i.event.bind(i.scrollbarY, 'focus', focus);
1246
+ i.event.bind(i.scrollbarY, 'blur', blur);
1282
1247
  i.scrollbarYActive = null;
1283
1248
  i.scrollbarYHeight = null;
1284
1249
  i.scrollbarYTop = null;
@@ -1334,10 +1299,7 @@ exports.get = function (element) {
1334
1299
  return instances[getId(element)];
1335
1300
  };
1336
1301
 
1337
- },{"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
1338
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
1339
- * Licensed under the MIT License
1340
- */
1302
+ },{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
1341
1303
  'use strict';
1342
1304
 
1343
1305
  var cls = require('../lib/class')
@@ -1466,9 +1428,6 @@ module.exports = function (element) {
1466
1428
  };
1467
1429
 
1468
1430
  },{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){
1469
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
1470
- * Licensed under the MIT License
1471
- */
1472
1431
  'use strict';
1473
1432
 
1474
1433
  var instances = require('./instances');
@@ -1511,29 +1470,25 @@ module.exports = function (element, axis, value) {
1511
1470
  }
1512
1471
 
1513
1472
  if (axis === 'top' && value <= 0) {
1514
- element.scrollTop = 0;
1473
+ element.scrollTop = value = 0; // don't allow negative scroll
1515
1474
  element.dispatchEvent(yStartEvent);
1516
- return; // don't allow negative scroll
1517
1475
  }
1518
1476
 
1519
1477
  if (axis === 'left' && value <= 0) {
1520
- element.scrollLeft = 0;
1478
+ element.scrollLeft = value = 0; // don't allow negative scroll
1521
1479
  element.dispatchEvent(xStartEvent);
1522
- return; // don't allow negative scroll
1523
1480
  }
1524
1481
 
1525
1482
  var i = instances.get(element);
1526
1483
 
1527
1484
  if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
1528
- element.scrollTop = i.contentHeight - i.containerHeight;
1485
+ element.scrollTop = value = i.contentHeight - i.containerHeight; // don't allow scroll past container
1529
1486
  element.dispatchEvent(yEndEvent);
1530
- return; // don't allow scroll past container
1531
1487
  }
1532
1488
 
1533
1489
  if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
1534
- element.scrollLeft = i.contentWidth - i.containerWidth;
1490
+ element.scrollLeft = value = i.contentWidth - i.containerWidth; // don't allow scroll past container
1535
1491
  element.dispatchEvent(xEndEvent);
1536
- return; // don't allow scroll past container
1537
1492
  }
1538
1493
 
1539
1494
  if (!lastTop) {
@@ -1573,9 +1528,6 @@ module.exports = function (element, axis, value) {
1573
1528
  };
1574
1529
 
1575
1530
  },{"./instances":18}],21:[function(require,module,exports){
1576
- /* Copyright (c) 2015 Hyunje Alex Jun and other contributors
1577
- * Licensed under the MIT License
1578
- */
1579
1531
  'use strict';
1580
1532
 
1581
1533
  var d = require('../lib/dom')
@@ -1,10 +1,11 @@
1
- /* perfect-scrollbar v0.6.8 */
1
+ /* perfect-scrollbar v0.6.9 */
2
2
  .ps-container {
3
3
  -ms-touch-action: none;
4
4
  overflow: hidden !important; }
5
5
  .ps-container.ps-active-x > .ps-scrollbar-x-rail,
6
6
  .ps-container.ps-active-y > .ps-scrollbar-y-rail {
7
- display: block; }
7
+ display: block;
8
+ background-color: transparent; }
8
9
  .ps-container.ps-in-scrolling {
9
10
  pointer-events: none; }
10
11
  .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
@@ -23,13 +24,12 @@
23
24
  /* please don't change 'position' */
24
25
  -webkit-border-radius: 4px;
25
26
  -moz-border-radius: 4px;
26
- -ms-border-radius: 4px;
27
27
  border-radius: 4px;
28
28
  opacity: 0;
29
- -webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
30
- -moz-transition: background-color 0.2s linear, opacity 0.2s linear;
31
- -o-transition: background-color 0.2s linear, opacity 0.2s linear;
32
- transition: background-color 0.2s linear, opacity 0.2s linear;
29
+ -webkit-transition: background-color .2s linear, opacity .2s linear;
30
+ -moz-transition: background-color .2s linear, opacity .2s linear;
31
+ -o-transition: background-color .2s linear, opacity .2s linear;
32
+ transition: background-color .2s linear, opacity .2s linear;
33
33
  bottom: 3px;
34
34
  /* there must be 'bottom' for ps-scrollbar-x-rail */
35
35
  height: 8px; }
@@ -39,12 +39,11 @@
39
39
  background-color: #aaa;
40
40
  -webkit-border-radius: 4px;
41
41
  -moz-border-radius: 4px;
42
- -ms-border-radius: 4px;
43
42
  border-radius: 4px;
44
- -webkit-transition: background-color 0.2s linear;
45
- -moz-transition: background-color 0.2s linear;
46
- -o-transition: background-color 0.2s linear;
47
- transition: background-color 0.2s linear;
43
+ -webkit-transition: background-color .2s linear;
44
+ -moz-transition: background-color .2s linear;
45
+ -o-transition: background-color .2s linear;
46
+ transition: background-color .2s linear;
48
47
  bottom: 0;
49
48
  /* there must be 'bottom' for ps-scrollbar-x */
50
49
  height: 8px; }
@@ -54,13 +53,12 @@
54
53
  /* please don't change 'position' */
55
54
  -webkit-border-radius: 4px;
56
55
  -moz-border-radius: 4px;
57
- -ms-border-radius: 4px;
58
56
  border-radius: 4px;
59
57
  opacity: 0;
60
- -webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
61
- -moz-transition: background-color 0.2s linear, opacity 0.2s linear;
62
- -o-transition: background-color 0.2s linear, opacity 0.2s linear;
63
- transition: background-color 0.2s linear, opacity 0.2s linear;
58
+ -webkit-transition: background-color .2s linear, opacity .2s linear;
59
+ -moz-transition: background-color .2s linear, opacity .2s linear;
60
+ -o-transition: background-color .2s linear, opacity .2s linear;
61
+ transition: background-color .2s linear, opacity .2s linear;
64
62
  right: 3px;
65
63
  /* there must be 'right' for ps-scrollbar-y-rail */
66
64
  width: 8px; }
@@ -70,12 +68,11 @@
70
68
  background-color: #aaa;
71
69
  -webkit-border-radius: 4px;
72
70
  -moz-border-radius: 4px;
73
- -ms-border-radius: 4px;
74
71
  border-radius: 4px;
75
- -webkit-transition: background-color 0.2s linear;
76
- -moz-transition: background-color 0.2s linear;
77
- -o-transition: background-color 0.2s linear;
78
- transition: background-color 0.2s linear;
72
+ -webkit-transition: background-color .2s linear;
73
+ -moz-transition: background-color .2s linear;
74
+ -o-transition: background-color .2s linear;
75
+ transition: background-color .2s linear;
79
76
  right: 0;
80
77
  /* there must be 'right' for ps-scrollbar-y */
81
78
  width: 8px; }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perfect-scrollbar-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8.1
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Hain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-23 00:00:00.000000000 Z
11
+ date: 2016-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties