mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-08 00:23:01 +08:00
23 lines
570 B
JavaScript
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();
|