diff --git a/examples/04-random-tests.html b/examples/04-random-tests.html index 1db8ec7..f4bf104 100644 --- a/examples/04-random-tests.html +++ b/examples/04-random-tests.html @@ -241,7 +241,10 @@

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

}).create() var ex7 = new GeminiScrollbar({ - element: document.querySelector('#example-7') + element: document.querySelector('#example-7'), + onResize: function() { + console.log(this.getViewElement()); + } }).create() } diff --git a/index.js b/index.js index 2cf6ce2..30a79cd 100644 --- a/index.js +++ b/index.js @@ -92,19 +92,6 @@ addClass(this.element, [CLASSNAMES.prevented]); if (this.onResize) { - // still need a resize trigger if we have an onResize callback, which - // also means we need a separate _viewElement to do the scrolling. - if (this.createElements === true) { - this._viewElement = document.createElement('div'); - while(this.element.childNodes.length > 0) { - this._viewElement.appendChild(this.element.childNodes[0]); - } - this.element.appendChild(this._viewElement); - } else { - this._viewElement = this.element.querySelector('.' + CLASSNAMES.view); - } - addClass(this.element, [CLASSNAMES.element]); - addClass(this._viewElement, [CLASSNAMES.view]); this._createResizeTrigger(); }