blivesta / drawer

Flexible drawer menu using jQuery, iScroll and CSS.
http://git.blivesta.com/drawer
MIT License
620 stars 178 forks source link

Refreshing iScroll #25

Open jbarkun opened 8 years ago

jbarkun commented 8 years ago

Hey! Thanks for the great plugin.

I have some dropdowns inside my drawer navigation, and am having some issues recalculating the drawer height for iScroll after opening them. Because iScroll is initialized through Drawer, what would be the best way to use the refresh() function to get the new drawer height? http://iscrolljs.com/#refresh

Thank you for your help!

oddlyfunctional commented 8 years ago

Hi @jbarkun! I've recently implemented a refresh function but didn't have time to update the docs yet. It doesn't quite work as you asked, though. It recreates the whole iScroll (useful for the cases where you dynamically load the whole drawer) by calling drawer.drawer('refresh'). If this doesn't solve your problem, let me know and I'll implement an accessor to the iScroll's refresh function.

tommueller commented 8 years ago

I definitely would need an accessor to iScroll's refresh function! Using the refresh function as is, my scroller jumps up while refreshing.

I already added it to mine softRefresh: function softRefresh() { return this.each(function() { var _this = this; return _this.iScroll.refresh(); }); },

Thanks!