mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 07:33:04 +08:00
daaa6a367b
* Adding custom scrollbar to global activities
22 lines
570 B
JavaScript
22 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();
|