2019-04-02 15:56:50 +08:00
|
|
|
/* global PerfectScrollbar */
|
2019-07-10 19:00:32 +08:00
|
|
|
var activePSB = [];
|
|
|
|
|
|
|
|
|
2019-04-02 15:56:50 +08:00
|
|
|
var PerfectSb = (function() {
|
2019-07-10 19:00:32 +08:00
|
|
|
function init() {
|
2020-01-29 18:14:25 +08:00
|
|
|
activePSB.length = 0;
|
2019-07-10 19:00:32 +08:00
|
|
|
$.each($('.perfect-scrollbar'), function(index, object) {
|
|
|
|
var ps;
|
|
|
|
ps = new PerfectScrollbar(object, { wheelSpeed: 0.5, minScrollbarLength: 20 });
|
|
|
|
activePSB.push(ps);
|
2019-04-02 15:56:50 +08:00
|
|
|
});
|
2019-07-10 19:00:32 +08:00
|
|
|
}
|
2019-04-02 15:56:50 +08:00
|
|
|
|
|
|
|
return Object.freeze({
|
|
|
|
update_all: function() {
|
2019-07-10 19:00:32 +08:00
|
|
|
$.each(activePSB, function(index, object) {
|
|
|
|
object.update();
|
2019-04-02 15:56:50 +08:00
|
|
|
});
|
2019-07-10 19:00:32 +08:00
|
|
|
},
|
|
|
|
init: function() {
|
|
|
|
init();
|
2019-04-02 15:56:50 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2019-07-10 19:00:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
PerfectSb().init();
|
|
|
|
});
|