Skip to content

Commit

Permalink
Fixed broken getScrollableEl() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
skrivle committed Oct 20, 2014
1 parent 249d72b commit 417b502
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,31 @@
* @return {jQuery}
*/
ScrollableNative.prototype.getScrollableEl = function () {
return this._query(this.getSettings().selectors.scrollableEl);

var selector;

if(typeof this._scrollable === 'undefined') {

selector = this.getSettings().selectors.scrollableEl;

if(typeof selector === 'undefined') {

// defaults to getEl()
this._scrollable = this.getEl();

}else if(typeof selector === 'string') {

// selector
this._scrollable = this._query(selector);
}else {

// jQuery object
this._scrollable = selector;
}

}

return this._scrollable;
};


Expand Down

0 comments on commit 417b502

Please sign in to comment.