scinote-web/app/assets/javascripts/sitewide/perfect_scrollbar.js
2020-01-29 11:14:25 +01:00

31 lines
603 B
JavaScript

/* global PerfectScrollbar */
var activePSB = [];
var PerfectSb = (function() {
function init() {
activePSB.length = 0;
$.each($('.perfect-scrollbar'), function(index, object) {
var ps;
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();
});