jQuery-slimScroll icon indicating copy to clipboard operation
jQuery-slimScroll copied to clipboard

Issue: configuration not updated after several changes

Open mamsellem opened this issue 6 years ago • 0 comments

Hello, the scrollbar config is stored in data("slimScrollConfig") on the first slimScroll() call but then not updated on further calls, which means that it will always use the initial config even if it was updated. steps to reproduce. $('some').slimScroll( { width: '100px'}); => width set to 100px $('some').slimScroll( { width: '200px'}); => width set to 200px $('some').slimScroll( { scrollBy: '10'}); => width set back to 100px.

adding the following line at line 221, fixes the issue: me.data('slimScrollConfig', $.extend( me.data('slimScrollConfig'), options));

[EDIT] I found another issue at line 124: $.extend(o, (me.data('slimScrollConfig') || {})); //retrieve previous config => this is not enough, you need to merge again with options, or it will use the initial options instead of the new one. full merge should be:

$.extend(o, (me.data('slimScrollConfig') || {}));
$.extend(o,options)); //merge with options

mamsellem avatar Oct 25 '19 11:10 mamsellem