diff --git a/README.md b/README.md index 72ea2ac..94ef041 100644 --- a/README.md +++ b/README.md @@ -328,10 +328,6 @@ The number of pixels the content width can surpass the container width without e The number of pixels the content height can surpass the container height without enabling the Y axis scroll bar. Allows some "wiggle room" or "offset break", so that Y axis scroll bar is not enabled just because of a few pixels. **Default**: `0` -### stopPropagationOnClick -When set to false, when clicking on a rail, the click event will be allowed to propagate. -**Default**: `true` - ### theme A string. It's a class name added to the container element. The class name is prepended with `ps-theme-`. So default theme class name is `ps-theme-default`. In order to create custom themes with scss use `ps-container($theme)` mixin, where `$theme` is a scss map. **Default**: `'default'` diff --git a/src/js/plugin/default-setting.js b/src/js/plugin/default-setting.js index 0228967..b3f2ddd 100644 --- a/src/js/plugin/default-setting.js +++ b/src/js/plugin/default-setting.js @@ -6,7 +6,6 @@ module.exports = { minScrollbarLength: null, scrollXMarginOffset: 0, scrollYMarginOffset: 0, - stopPropagationOnClick: true, suppressScrollX: false, suppressScrollY: false, swipePropagation: true, diff --git a/src/js/plugin/handler/click-rail.js b/src/js/plugin/handler/click-rail.js index f78da5c..b8d5928 100644 --- a/src/js/plugin/handler/click-rail.js +++ b/src/js/plugin/handler/click-rail.js @@ -11,9 +11,7 @@ function bindClickRailHandler(element, i) { } var stopPropagation = function (e) { e.stopPropagation(); }; - if (i.settings.stopPropagationOnClick) { - i.event.bind(i.scrollbarY, 'click', stopPropagation); - } + i.event.bind(i.scrollbarY, 'click', stopPropagation); i.event.bind(i.scrollbarYRail, 'click', function (e) { var halfOfScrollbarLength = _.toInt(i.scrollbarYHeight / 2); var positionTop = i.railYRatio * (e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top - halfOfScrollbarLength); @@ -32,9 +30,7 @@ function bindClickRailHandler(element, i) { e.stopPropagation(); }); - if (i.settings.stopPropagationOnClick) { - i.event.bind(i.scrollbarX, 'click', stopPropagation); - } + i.event.bind(i.scrollbarX, 'click', stopPropagation); i.event.bind(i.scrollbarXRail, 'click', function (e) { var halfOfScrollbarLength = _.toInt(i.scrollbarXWidth / 2); var positionLeft = i.railXRatio * (e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left - halfOfScrollbarLength);