iominh / ng-scrollbars

Angular wrapper of Malihu's jQuery Custom Scrollbar
http://iominh.github.io/ng-scrollbars/
MIT License
202 stars 62 forks source link

Specific config kills general (default) config #69

Open poshest opened 7 years ago

poshest commented 7 years ago

I have some default config thus:

ScrollBarsProvider.defaults = {
...
, "mouseWheel": {
        "scrollAmount": 100 
      , "preventDefault": true
      ...
   }
...
}

Then in a specific instance I want to override "preventDefault": false, but leave all of the other settings, such as "scrollAmount": 100 intact.

Your config merge routine in the render function seems to intelligently merge config in the way I want, but only at the "top" level of the config object. Nested "general" objects are just replaced whole by the "specific" objects. Eg scrollAmount in the above example is killed.

Couldn't you just use an angular.merge in render? I note that it has been just freshly deprecated in 1.6.5, but as they say, angular.merge "will not be removed in the 1.x lifecycle".

Thanks!