Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollbar elements always removed on destroy() no matter what createElements option is #7

Closed
flexphperia opened this issue Jun 21, 2015 · 4 comments

Comments

@flexphperia
Copy link

When createElements option is set to false plugin should not destroy scrollbar and view div's when called destroy() method.

@flexphperia flexphperia changed the title scrollbar elements always removed on destroy() no matter what createElements option is scrollbar elements always removed on destroy() no matter what createElement option is Jun 21, 2015
@flexphperia flexphperia changed the title scrollbar elements always removed on destroy() no matter what createElement option is scrollbar elements always removed on destroy() no matter what createElements option is Jun 21, 2015
@noeldelgado
Copy link
Owner

Thanks for the report, I also added a new example to test this issue, you can find it on the examples folder, file 05-destroy.html.

@flexphperia
Copy link
Author

Now it looks good but, now when calling destroy when createElements = false references to document and window are not cleaned.
I'm not sure that I want gm-prevented added to my container after destroy. Maybe destroy method should get one parameter to remove everything or not?

Another problem is that when when createElements = false in create method plugin re aranges my scrollbar and view divs because it still calls:

this.element.appendChild(this._scrollbarVerticalElement);
this.element.appendChild(this._scrollbarHorizontalElement);
this.element.appendChild(this._viewElement);

@noeldelgado
Copy link
Owner

Hey @flexphperia, just fixed those issues on this commit fdd8b4c.

No more gm-prevented added after calling destroy, no more elements appended on the create method if createElements option is false and document and window references are now cleaned on destroy.

Thanks!

@flexphperia
Copy link
Author

@noeldelgado references still not cleared when SCROLLBAR_WIDTH === 0
Also there should be: this._viewElement = this.element = null;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants