perfect-scrollbar-rails 0.6.12 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0f3739a83bff71b323487436d28aa884c001600
|
4
|
+
data.tar.gz: 10946fd93dbafcb50a5313b1278e6fe909a47aed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7383a7daae79e76f04e3cb874d4c644efcd3b68b0ddfe194eb928e88414bab492806deb9281b5e3d192c22b1ae8f0a5f66e740fb5e61c323c1b3f57088b8aeb
|
7
|
+
data.tar.gz: 6caca1bba72ca7bda171233f52a30fd9fcc11dcf021592dc44c5af32fe02f43ad06377eb45322b941166e5edfecae1bd7885d47e1331f50af097ae64dba0d306
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/* perfect-scrollbar v0.6.
|
1
|
+
/* perfect-scrollbar v0.6.13 */
|
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
3
|
'use strict';
|
4
4
|
|
@@ -271,7 +271,7 @@ var toInt = exports.toInt = function (x) {
|
|
271
271
|
};
|
272
272
|
|
273
273
|
var clone = exports.clone = function (obj) {
|
274
|
-
if (obj
|
274
|
+
if (!obj) {
|
275
275
|
return null;
|
276
276
|
} else if (obj.constructor === Array) {
|
277
277
|
return obj.map(clone);
|
@@ -367,7 +367,6 @@ module.exports = {
|
|
367
367
|
minScrollbarLength: null,
|
368
368
|
scrollXMarginOffset: 0,
|
369
369
|
scrollYMarginOffset: 0,
|
370
|
-
stopPropagationOnClick: true,
|
371
370
|
suppressScrollX: false,
|
372
371
|
suppressScrollY: false,
|
373
372
|
swipePropagation: true,
|
@@ -404,7 +403,6 @@ module.exports = function (element) {
|
|
404
403
|
},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){
|
405
404
|
'use strict';
|
406
405
|
|
407
|
-
var _ = require('../../lib/helper');
|
408
406
|
var instances = require('../instances');
|
409
407
|
var updateGeometry = require('../update-geometry');
|
410
408
|
var updateScroll = require('../update-scroll');
|
@@ -415,43 +413,23 @@ function bindClickRailHandler(element, i) {
|
|
415
413
|
}
|
416
414
|
var stopPropagation = function (e) { e.stopPropagation(); };
|
417
415
|
|
418
|
-
|
419
|
-
i.event.bind(i.scrollbarY, 'click', stopPropagation);
|
420
|
-
}
|
416
|
+
i.event.bind(i.scrollbarY, 'click', stopPropagation);
|
421
417
|
i.event.bind(i.scrollbarYRail, 'click', function (e) {
|
422
|
-
var
|
423
|
-
var
|
424
|
-
var maxPositionTop = i.railYRatio * (i.railYHeight - i.scrollbarYHeight);
|
425
|
-
var positionRatio = positionTop / maxPositionTop;
|
426
|
-
|
427
|
-
if (positionRatio < 0) {
|
428
|
-
positionRatio = 0;
|
429
|
-
} else if (positionRatio > 1) {
|
430
|
-
positionRatio = 1;
|
431
|
-
}
|
418
|
+
var positionTop = e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top;
|
419
|
+
var direction = positionTop > i.scrollbarYTop ? 1 : -1;
|
432
420
|
|
433
|
-
updateScroll(element, 'top',
|
421
|
+
updateScroll(element, 'top', element.scrollTop + direction * i.containerHeight);
|
434
422
|
updateGeometry(element);
|
435
423
|
|
436
424
|
e.stopPropagation();
|
437
425
|
});
|
438
426
|
|
439
|
-
|
440
|
-
i.event.bind(i.scrollbarX, 'click', stopPropagation);
|
441
|
-
}
|
427
|
+
i.event.bind(i.scrollbarX, 'click', stopPropagation);
|
442
428
|
i.event.bind(i.scrollbarXRail, 'click', function (e) {
|
443
|
-
var
|
444
|
-
var
|
445
|
-
var maxPositionLeft = i.railXRatio * (i.railXWidth - i.scrollbarXWidth);
|
446
|
-
var positionRatio = positionLeft / maxPositionLeft;
|
447
|
-
|
448
|
-
if (positionRatio < 0) {
|
449
|
-
positionRatio = 0;
|
450
|
-
} else if (positionRatio > 1) {
|
451
|
-
positionRatio = 1;
|
452
|
-
}
|
429
|
+
var positionLeft = e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left;
|
430
|
+
var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
|
453
431
|
|
454
|
-
updateScroll(element, 'left',
|
432
|
+
updateScroll(element, 'left', element.scrollLeft + direction * i.containerWidth);
|
455
433
|
updateGeometry(element);
|
456
434
|
|
457
435
|
e.stopPropagation();
|
@@ -463,7 +441,7 @@ module.exports = function (element) {
|
|
463
441
|
bindClickRailHandler(element, i);
|
464
442
|
};
|
465
443
|
|
466
|
-
},{"
|
444
|
+
},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){
|
467
445
|
'use strict';
|
468
446
|
|
469
447
|
var _ = require('../../lib/helper');
|
@@ -642,16 +620,40 @@ function bindKeyboardHandler(element, i) {
|
|
642
620
|
|
643
621
|
switch (e.which) {
|
644
622
|
case 37: // left
|
645
|
-
|
623
|
+
if (e.metaKey) {
|
624
|
+
deltaX = -i.contentWidth;
|
625
|
+
} else if (e.altKey) {
|
626
|
+
deltaX = -i.containerWidth;
|
627
|
+
} else {
|
628
|
+
deltaX = -30;
|
629
|
+
}
|
646
630
|
break;
|
647
631
|
case 38: // up
|
648
|
-
|
632
|
+
if (e.metaKey) {
|
633
|
+
deltaY = i.contentHeight;
|
634
|
+
} else if (e.altKey) {
|
635
|
+
deltaY = i.containerHeight;
|
636
|
+
} else {
|
637
|
+
deltaY = 30;
|
638
|
+
}
|
649
639
|
break;
|
650
640
|
case 39: // right
|
651
|
-
|
641
|
+
if (e.metaKey) {
|
642
|
+
deltaX = i.contentWidth;
|
643
|
+
} else if (e.altKey) {
|
644
|
+
deltaX = i.containerWidth;
|
645
|
+
} else {
|
646
|
+
deltaX = 30;
|
647
|
+
}
|
652
648
|
break;
|
653
649
|
case 40: // down
|
654
|
-
|
650
|
+
if (e.metaKey) {
|
651
|
+
deltaY = -i.contentHeight;
|
652
|
+
} else if (e.altKey) {
|
653
|
+
deltaY = -i.containerHeight;
|
654
|
+
} else {
|
655
|
+
deltaY = -30;
|
656
|
+
}
|
655
657
|
break;
|
656
658
|
case 33: // page up
|
657
659
|
deltaY = 90;
|
@@ -755,13 +757,18 @@ function bindMouseWheelHandler(element, i) {
|
|
755
757
|
deltaY = e.wheelDelta;
|
756
758
|
}
|
757
759
|
|
760
|
+
if (e.shiftKey) {
|
761
|
+
// reverse axis with shift key
|
762
|
+
return [-deltaY, -deltaX];
|
763
|
+
}
|
758
764
|
return [deltaX, deltaY];
|
759
765
|
}
|
760
766
|
|
761
767
|
function shouldBeConsumedByChild(deltaX, deltaY) {
|
762
768
|
var child = element.querySelector('textarea:hover, select[multiple]:hover, .ps-child:hover');
|
763
769
|
if (child) {
|
764
|
-
if (
|
770
|
+
if (!window.getComputedStyle(child).overflow.match(/(scroll|auto)/)) {
|
771
|
+
// if not scrollable
|
765
772
|
return false;
|
766
773
|
}
|
767
774
|
|
@@ -913,6 +920,12 @@ function bindSelectionHandler(element, i) {
|
|
913
920
|
stopScrolling();
|
914
921
|
}
|
915
922
|
});
|
923
|
+
i.event.bind(window, 'keyup', function () {
|
924
|
+
if (isSelected) {
|
925
|
+
isSelected = false;
|
926
|
+
stopScrolling();
|
927
|
+
}
|
928
|
+
});
|
916
929
|
|
917
930
|
i.event.bind(window, 'mousemove', function (e) {
|
918
931
|
if (isSelected) {
|
@@ -1097,6 +1110,11 @@ function bindTouchHandler(element, i, supportsTouch, supportsIePointer) {
|
|
1097
1110
|
return;
|
1098
1111
|
}
|
1099
1112
|
|
1113
|
+
if (!speed.x && !speed.y) {
|
1114
|
+
clearInterval(easingLoop);
|
1115
|
+
return;
|
1116
|
+
}
|
1117
|
+
|
1100
1118
|
if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
|
1101
1119
|
clearInterval(easingLoop);
|
1102
1120
|
return;
|
@@ -1425,29 +1443,14 @@ module.exports = function (element) {
|
|
1425
1443
|
|
1426
1444
|
var instances = require('./instances');
|
1427
1445
|
|
1428
|
-
var upEvent = document.createEvent('Event');
|
1429
|
-
var downEvent = document.createEvent('Event');
|
1430
|
-
var leftEvent = document.createEvent('Event');
|
1431
|
-
var rightEvent = document.createEvent('Event');
|
1432
|
-
var yEvent = document.createEvent('Event');
|
1433
|
-
var xEvent = document.createEvent('Event');
|
1434
|
-
var xStartEvent = document.createEvent('Event');
|
1435
|
-
var xEndEvent = document.createEvent('Event');
|
1436
|
-
var yStartEvent = document.createEvent('Event');
|
1437
|
-
var yEndEvent = document.createEvent('Event');
|
1438
1446
|
var lastTop;
|
1439
1447
|
var lastLeft;
|
1440
1448
|
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
xEvent.initEvent('ps-scroll-x', true, true);
|
1447
|
-
xStartEvent.initEvent('ps-x-reach-start', true, true);
|
1448
|
-
xEndEvent.initEvent('ps-x-reach-end', true, true);
|
1449
|
-
yStartEvent.initEvent('ps-y-reach-start', true, true);
|
1450
|
-
yEndEvent.initEvent('ps-y-reach-end', true, true);
|
1449
|
+
var createDOMEvent = function (name) {
|
1450
|
+
var event = document.createEvent("Event");
|
1451
|
+
event.initEvent(name, true, true);
|
1452
|
+
return event;
|
1453
|
+
};
|
1451
1454
|
|
1452
1455
|
module.exports = function (element, axis, value) {
|
1453
1456
|
if (typeof element === 'undefined') {
|
@@ -1464,12 +1467,12 @@ module.exports = function (element, axis, value) {
|
|
1464
1467
|
|
1465
1468
|
if (axis === 'top' && value <= 0) {
|
1466
1469
|
element.scrollTop = value = 0; // don't allow negative scroll
|
1467
|
-
element.dispatchEvent(
|
1470
|
+
element.dispatchEvent(createDOMEvent('ps-y-reach-start'));
|
1468
1471
|
}
|
1469
1472
|
|
1470
1473
|
if (axis === 'left' && value <= 0) {
|
1471
1474
|
element.scrollLeft = value = 0; // don't allow negative scroll
|
1472
|
-
element.dispatchEvent(
|
1475
|
+
element.dispatchEvent(createDOMEvent('ps-x-reach-start'));
|
1473
1476
|
}
|
1474
1477
|
|
1475
1478
|
var i = instances.get(element);
|
@@ -1483,7 +1486,7 @@ module.exports = function (element, axis, value) {
|
|
1483
1486
|
} else {
|
1484
1487
|
element.scrollTop = value;
|
1485
1488
|
}
|
1486
|
-
element.dispatchEvent(
|
1489
|
+
element.dispatchEvent(createDOMEvent('ps-y-reach-end'));
|
1487
1490
|
}
|
1488
1491
|
|
1489
1492
|
if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
|
@@ -1495,7 +1498,7 @@ module.exports = function (element, axis, value) {
|
|
1495
1498
|
} else {
|
1496
1499
|
element.scrollLeft = value;
|
1497
1500
|
}
|
1498
|
-
element.dispatchEvent(
|
1501
|
+
element.dispatchEvent(createDOMEvent('ps-x-reach-end'));
|
1499
1502
|
}
|
1500
1503
|
|
1501
1504
|
if (!lastTop) {
|
@@ -1507,29 +1510,29 @@ module.exports = function (element, axis, value) {
|
|
1507
1510
|
}
|
1508
1511
|
|
1509
1512
|
if (axis === 'top' && value < lastTop) {
|
1510
|
-
element.dispatchEvent(
|
1513
|
+
element.dispatchEvent(createDOMEvent('ps-scroll-up'));
|
1511
1514
|
}
|
1512
1515
|
|
1513
1516
|
if (axis === 'top' && value > lastTop) {
|
1514
|
-
element.dispatchEvent(
|
1517
|
+
element.dispatchEvent(createDOMEvent('ps-scroll-down'));
|
1515
1518
|
}
|
1516
1519
|
|
1517
1520
|
if (axis === 'left' && value < lastLeft) {
|
1518
|
-
element.dispatchEvent(
|
1521
|
+
element.dispatchEvent(createDOMEvent('ps-scroll-left'));
|
1519
1522
|
}
|
1520
1523
|
|
1521
1524
|
if (axis === 'left' && value > lastLeft) {
|
1522
|
-
element.dispatchEvent(
|
1525
|
+
element.dispatchEvent(createDOMEvent('ps-scroll-right'));
|
1523
1526
|
}
|
1524
1527
|
|
1525
1528
|
if (axis === 'top') {
|
1526
1529
|
element.scrollTop = lastTop = value;
|
1527
|
-
element.dispatchEvent(
|
1530
|
+
element.dispatchEvent(createDOMEvent('ps-scroll-y'));
|
1528
1531
|
}
|
1529
1532
|
|
1530
1533
|
if (axis === 'left') {
|
1531
1534
|
element.scrollLeft = lastLeft = value;
|
1532
|
-
element.dispatchEvent(
|
1535
|
+
element.dispatchEvent(createDOMEvent('ps-scroll-x'));
|
1533
1536
|
}
|
1534
1537
|
|
1535
1538
|
};
|
@@ -1,7 +1,7 @@
|
|
1
|
-
/* perfect-scrollbar v0.6.
|
1
|
+
/* perfect-scrollbar v0.6.13 */
|
2
2
|
.ps-container {
|
3
|
-
-ms-touch-action:
|
4
|
-
touch-action:
|
3
|
+
-ms-touch-action: auto;
|
4
|
+
touch-action: auto;
|
5
5
|
overflow: hidden !important;
|
6
6
|
-ms-overflow-style: none; }
|
7
7
|
@supports (-ms-overflow-style: none) {
|
@@ -14,26 +14,26 @@
|
|
14
14
|
.ps-container.ps-active-y > .ps-scrollbar-y-rail {
|
15
15
|
display: block;
|
16
16
|
background-color: transparent; }
|
17
|
-
.ps-container.ps-in-scrolling {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
17
|
+
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
|
18
|
+
background-color: #eee;
|
19
|
+
opacity: 0.9; }
|
20
|
+
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
|
21
|
+
background-color: #999;
|
22
|
+
height: 11px; }
|
23
|
+
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
|
24
|
+
background-color: #eee;
|
25
|
+
opacity: 0.9; }
|
26
|
+
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
|
27
|
+
background-color: #999;
|
28
|
+
width: 11px; }
|
29
29
|
.ps-container > .ps-scrollbar-x-rail {
|
30
30
|
display: none;
|
31
31
|
position: absolute;
|
32
32
|
/* please don't change 'position' */
|
33
33
|
opacity: 0;
|
34
34
|
-webkit-transition: background-color .2s linear, opacity .2s linear;
|
35
|
-
-moz-transition: background-color .2s linear, opacity .2s linear;
|
36
35
|
-o-transition: background-color .2s linear, opacity .2s linear;
|
36
|
+
-moz-transition: background-color .2s linear, opacity .2s linear;
|
37
37
|
transition: background-color .2s linear, opacity .2s linear;
|
38
38
|
bottom: 0px;
|
39
39
|
/* there must be 'bottom' for ps-scrollbar-x-rail */
|
@@ -47,8 +47,8 @@
|
|
47
47
|
border-radius: 6px;
|
48
48
|
-webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
|
49
49
|
transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
|
50
|
-
-moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
|
51
50
|
-o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
|
51
|
+
-moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
|
52
52
|
transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
|
53
53
|
transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
|
54
54
|
bottom: 2px;
|
@@ -62,8 +62,8 @@
|
|
62
62
|
/* please don't change 'position' */
|
63
63
|
opacity: 0;
|
64
64
|
-webkit-transition: background-color .2s linear, opacity .2s linear;
|
65
|
-
-moz-transition: background-color .2s linear, opacity .2s linear;
|
66
65
|
-o-transition: background-color .2s linear, opacity .2s linear;
|
66
|
+
-moz-transition: background-color .2s linear, opacity .2s linear;
|
67
67
|
transition: background-color .2s linear, opacity .2s linear;
|
68
68
|
right: 0;
|
69
69
|
/* there must be 'right' for ps-scrollbar-y-rail */
|
@@ -77,8 +77,8 @@
|
|
77
77
|
border-radius: 6px;
|
78
78
|
-webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
|
79
79
|
transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
|
80
|
-
-moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
|
81
80
|
-o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
|
81
|
+
-moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
|
82
82
|
transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
|
83
83
|
transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
|
84
84
|
right: 2px;
|
@@ -86,18 +86,18 @@
|
|
86
86
|
width: 6px; }
|
87
87
|
.ps-container > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y, .ps-container > .ps-scrollbar-y-rail:active > .ps-scrollbar-y {
|
88
88
|
width: 11px; }
|
89
|
-
.ps-container:hover.ps-in-scrolling {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
89
|
+
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
|
90
|
+
background-color: #eee;
|
91
|
+
opacity: 0.9; }
|
92
|
+
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
|
93
|
+
background-color: #999;
|
94
|
+
height: 11px; }
|
95
|
+
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
|
96
|
+
background-color: #eee;
|
97
|
+
opacity: 0.9; }
|
98
|
+
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
|
99
|
+
background-color: #999;
|
100
|
+
width: 11px; }
|
101
101
|
.ps-container:hover > .ps-scrollbar-x-rail,
|
102
102
|
.ps-container:hover > .ps-scrollbar-y-rail {
|
103
103
|
opacity: 0.6; }
|
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.
|
4
|
+
version: 0.6.13
|
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-
|
11
|
+
date: 2016-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.6.
|
100
|
+
rubygems_version: 2.6.8
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: This Gem integrates noraesae's Jquery perfect-scrollbar with Rails, exposing
|