Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mdbootstrap/TW-Elements
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: zoomsphere/perfect-scrollbar
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Jul 10, 2018

  1. add swipeStopPropagation

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    0ca4fca View commit details
  2. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    3857f55 View commit details
  3. build dist

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    291bbca View commit details
  4. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    50686dc View commit details
  5. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    c8bb73b View commit details
  6. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    b90faf3 View commit details
  7. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    fc1ddb5 View commit details
  8. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    23c6b20 View commit details
  9. increase version

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    80e6e30 View commit details
  10. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    93a2eb0 View commit details
  11. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    92d590e View commit details
  12. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    8b46dd2 View commit details
  13. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    db326b9 View commit details
  14. update

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    60e8fe7 View commit details
  15. update

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    41603b0 View commit details
  16. update

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    b20b7ee View commit details
  17. update

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    5eb0c2c View commit details
  18. remove debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    0afa6e0 View commit details
  19. remove debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    642bd09 View commit details
  20. debug

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    958a3df View commit details
  21. update

    vojtesaak committed Jul 10, 2018
    Copy the full SHA
    3c906cb View commit details
Showing with 122 additions and 1,788 deletions.
  1. +30 −6 dist/perfect-scrollbar.common.js
  2. +30 −6 dist/perfect-scrollbar.esm.js
  3. +30 −6 dist/perfect-scrollbar.js
  4. +2 −2 dist/perfect-scrollbar.min.js
  5. +0 −1,762 package-lock.json
  6. +1 −1 package.json
  7. +0 −1 src/handlers/mouse-wheel.js
  8. +28 −4 src/handlers/touch.js
  9. +1 −0 src/index.js
36 changes: 30 additions & 6 deletions dist/perfect-scrollbar.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* perfect-scrollbar v1.4.0
* perfect-scrollbar v1.4.2
* (c) 2018 Hyunje Jun
* @license MIT
*/
@@ -725,7 +725,6 @@ var keyboard = function(i) {

var wheel = function(i) {
var element = i.element;

function shouldPreventDefault(deltaX, deltaY) {
var roundedScrollTop = Math.floor(element.scrollTop);
var isTop = element.scrollTop === 0;
@@ -884,7 +883,10 @@ var touch = function(i) {

var element = i.element;

function shouldPrevent(deltaX, deltaY) {
function shouldPrevent(deltaX, deltaY, e) {
if (!e.cancelable) {
return false;
}
var scrollTop = Math.floor(element.scrollTop);
var scrollLeft = element.scrollLeft;
var magnitudeX = Math.abs(deltaX);
@@ -953,10 +955,11 @@ var touch = function(i) {
}

function touchStart(e) {
resolveSwipePropagation(e);

if (!shouldHandle(e)) {
return;
}

var touch = getTouch(e);

startOffset.pageX = touch.pageX;
@@ -1015,6 +1018,9 @@ var touch = function(i) {
}

function touchMove(e) {

resolveSwipePropagation(e);

if (shouldHandle(e)) {
var touch = getTouch(e);

@@ -1039,12 +1045,15 @@ var touch = function(i) {
startTime = currentTime;
}

if (shouldPrevent(differenceX, differenceY)) {
if (shouldPrevent(differenceX, differenceY, e)) {
e.preventDefault();
}
}
}
function touchEnd() {
function touchEnd(e) {

resolveSwipePropagation(e);

if (i.settings.swipeEasing) {
clearInterval(easingLoop);
easingLoop = setInterval(function() {
@@ -1071,6 +1080,20 @@ var touch = function(i) {
}
}

function resolveSwipePropagation(e) {
if (!i.settings.swipePropagation && !(isXScrollbarOnEdge() || isYScrollbarOnEdge())) {
e.stopPropagation();
}
}

function isXScrollbarOnEdge() {
return i.scrollbarXActive && (i.reach.x === 'end' || i.reach.x === 'start');
}

function isYScrollbarOnEdge() {
return i.scrollbarYActive && (i.reach.y === 'end' || i.reach.y === 'start');
}

if (env.supportsTouch) {
i.event.bind(element, 'touchstart', touchStart);
i.event.bind(element, 'touchmove', touchMove);
@@ -1098,6 +1121,7 @@ var defaultSettings = function () { return ({
suppressScrollX: false,
suppressScrollY: false,
swipeEasing: true,
swipePropagation: true,
useBothWheelAxes: false,
wheelPropagation: true,
wheelSpeed: 1,
36 changes: 30 additions & 6 deletions dist/perfect-scrollbar.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* perfect-scrollbar v1.4.0
* perfect-scrollbar v1.4.2
* (c) 2018 Hyunje Jun
* @license MIT
*/
@@ -723,7 +723,6 @@ var keyboard = function(i) {

var wheel = function(i) {
var element = i.element;

function shouldPreventDefault(deltaX, deltaY) {
var roundedScrollTop = Math.floor(element.scrollTop);
var isTop = element.scrollTop === 0;
@@ -882,7 +881,10 @@ var touch = function(i) {

var element = i.element;

function shouldPrevent(deltaX, deltaY) {
function shouldPrevent(deltaX, deltaY, e) {
if (!e.cancelable) {
return false;
}
var scrollTop = Math.floor(element.scrollTop);
var scrollLeft = element.scrollLeft;
var magnitudeX = Math.abs(deltaX);
@@ -951,10 +953,11 @@ var touch = function(i) {
}

function touchStart(e) {
resolveSwipePropagation(e);

if (!shouldHandle(e)) {
return;
}

var touch = getTouch(e);

startOffset.pageX = touch.pageX;
@@ -1013,6 +1016,9 @@ var touch = function(i) {
}

function touchMove(e) {

resolveSwipePropagation(e);

if (shouldHandle(e)) {
var touch = getTouch(e);

@@ -1037,12 +1043,15 @@ var touch = function(i) {
startTime = currentTime;
}

if (shouldPrevent(differenceX, differenceY)) {
if (shouldPrevent(differenceX, differenceY, e)) {
e.preventDefault();
}
}
}
function touchEnd() {
function touchEnd(e) {

resolveSwipePropagation(e);

if (i.settings.swipeEasing) {
clearInterval(easingLoop);
easingLoop = setInterval(function() {
@@ -1069,6 +1078,20 @@ var touch = function(i) {
}
}

function resolveSwipePropagation(e) {
if (!i.settings.swipePropagation && !(isXScrollbarOnEdge() || isYScrollbarOnEdge())) {
e.stopPropagation();
}
}

function isXScrollbarOnEdge() {
return i.scrollbarXActive && (i.reach.x === 'end' || i.reach.x === 'start');
}

function isYScrollbarOnEdge() {
return i.scrollbarYActive && (i.reach.y === 'end' || i.reach.y === 'start');
}

if (env.supportsTouch) {
i.event.bind(element, 'touchstart', touchStart);
i.event.bind(element, 'touchmove', touchMove);
@@ -1096,6 +1119,7 @@ var defaultSettings = function () { return ({
suppressScrollX: false,
suppressScrollY: false,
swipeEasing: true,
swipePropagation: true,
useBothWheelAxes: false,
wheelPropagation: true,
wheelSpeed: 1,
36 changes: 30 additions & 6 deletions dist/perfect-scrollbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* perfect-scrollbar v1.4.0
* perfect-scrollbar v1.4.2
* (c) 2018 Hyunje Jun
* @license MIT
*/
@@ -729,7 +729,6 @@ var keyboard = function(i) {

var wheel = function(i) {
var element = i.element;

function shouldPreventDefault(deltaX, deltaY) {
var roundedScrollTop = Math.floor(element.scrollTop);
var isTop = element.scrollTop === 0;
@@ -888,7 +887,10 @@ var touch = function(i) {

var element = i.element;

function shouldPrevent(deltaX, deltaY) {
function shouldPrevent(deltaX, deltaY, e) {
if (!e.cancelable) {
return false;
}
var scrollTop = Math.floor(element.scrollTop);
var scrollLeft = element.scrollLeft;
var magnitudeX = Math.abs(deltaX);
@@ -957,10 +959,11 @@ var touch = function(i) {
}

function touchStart(e) {
resolveSwipePropagation(e);

if (!shouldHandle(e)) {
return;
}

var touch = getTouch(e);

startOffset.pageX = touch.pageX;
@@ -1019,6 +1022,9 @@ var touch = function(i) {
}

function touchMove(e) {

resolveSwipePropagation(e);

if (shouldHandle(e)) {
var touch = getTouch(e);

@@ -1043,12 +1049,15 @@ var touch = function(i) {
startTime = currentTime;
}

if (shouldPrevent(differenceX, differenceY)) {
if (shouldPrevent(differenceX, differenceY, e)) {
e.preventDefault();
}
}
}
function touchEnd() {
function touchEnd(e) {

resolveSwipePropagation(e);

if (i.settings.swipeEasing) {
clearInterval(easingLoop);
easingLoop = setInterval(function() {
@@ -1075,6 +1084,20 @@ var touch = function(i) {
}
}

function resolveSwipePropagation(e) {
if (!i.settings.swipePropagation && !(isXScrollbarOnEdge() || isYScrollbarOnEdge())) {
e.stopPropagation();
}
}

function isXScrollbarOnEdge() {
return i.scrollbarXActive && (i.reach.x === 'end' || i.reach.x === 'start');
}

function isYScrollbarOnEdge() {
return i.scrollbarYActive && (i.reach.y === 'end' || i.reach.y === 'start');
}

if (env.supportsTouch) {
i.event.bind(element, 'touchstart', touchStart);
i.event.bind(element, 'touchmove', touchMove);
@@ -1102,6 +1125,7 @@ var defaultSettings = function () { return ({
suppressScrollX: false,
suppressScrollY: false,
swipeEasing: true,
swipePropagation: true,
useBothWheelAxes: false,
wheelPropagation: true,
wheelSpeed: 1,
Loading