scinote-web/app/assets/javascripts/sitewide/perfect_scrollbar.js
aignatov-bio 7ac410e573
Fix visual bugs across ProtocolIo [SCI-3671] (#1914)
* Fix visual bugs across ProtocolIo
2019-07-10 13:00:32 +02:00

30 lines
605 B
JavaScript

/* global PerfectScrollbar */
var activePSB = [];
var PerfectSb = (function() {
function init() {
$.each($('.perfect-scrollbar'), function(index, object) {
var ps;
activePSB.lenght = 0;
ps = new PerfectScrollbar(object, { wheelSpeed: 0.5, minScrollbarLength: 20 });
activePSB.push(ps);
});
}
return Object.freeze({
update_all: function() {
$.each(activePSB, function(index, object) {
object.update();
});
},
init: function() {
init();
}
});
});
$(document).on('turbolinks:load', function() {
PerfectSb().init();
});