diff --git a/selectableScroll.js b/selectableScroll.js index 4718f43..16e78e8 100644 --- a/selectableScroll.js +++ b/selectableScroll.js @@ -21,7 +21,7 @@ (function ($) { $.widget('ui.selectableScroll', $.ui.selectable, { options: { - useParentForScrolling: false, // If true, targets the parent element for scrolling + scrollElement: null, // If an element is passed in here, use it for scrolling instead of widget's element scrollSnapX: 5, // When the selection is that pixels near to the top/bottom edges, start to scroll scrollSnapY: 5, // When the selection is that pixels near to the side edges, start to scroll scrollAmount: 25, // In pixels @@ -38,7 +38,7 @@ this.element.addClass("ui-selectable"); this.dragged = false; this.helperClasses = ['no-top', 'no-right', 'no-bottom', 'no-left']; - this.scrollElement = this._getScrollElement(); + this.scrollElement = this.options.scrollElement || this.element; // cache selectee children based on filter this.refresh = function() { @@ -213,17 +213,6 @@ }; }, - /** - * Returns the element to apply scrolling to. (Sometimes we'll want to use the parent element of the selectable.) - */ - _getScrollElement: function () { - if (this.options.useParentForScrolling) { - return this.element.parent(); - } - - return this.element; - }, - /** * Update the selected elements * @param {object} options The return value of _calcRelativeArea()