scinote-web/app/assets/javascripts/sitewide/perfect_scrollbar.js
aignatov-bio daaa6a367b
Adding custom scrollbar to global activities [SCI-3206] (#1623)
* Adding custom scrollbar to global activities
2019-04-02 09:56:50 +02:00

23 lines
570 B
JavaScript

/* global PerfectScrollbar */
var PerfectSb = (function() {
(function() {
$(document).on('turbolinks:load', function() {
$.each($('.perfect-scrollbar'), function(index, object) {
var ps = new PerfectScrollbar(object, { wheelSpeed: 0.5 });
$(object).bind('update_scroll', () => {
ps.update();
});
});
});
})();
return Object.freeze({
update_all: function() {
$.each($('.perfect-scrollbar'), function(index, object) {
$(object).trigger('update_scroll');
});
}
});
});
PerfectSb();