mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-07-04 10:19:09 +02:00
Fixed issue with touch devices and the new scrollbar
This commit is contained in:
@@ -4,31 +4,35 @@ import GeminiScrollbar from 'gemini-scrollbar';
|
||||
const defaults = {
|
||||
autoshow: false,
|
||||
createElements: true,
|
||||
forceGemini: true
|
||||
forceGemini: false
|
||||
};
|
||||
|
||||
export default class Scrollbar {
|
||||
constructor(element, options) {
|
||||
this.element = $(element);
|
||||
this.created = false;
|
||||
if (!this.element.length) { return; }
|
||||
|
||||
this.options = Object.assign({}, defaults, options, { element: this.element[0] });
|
||||
|
||||
this.instance = new GeminiScrollbar(this.options).create();
|
||||
this.element.css('overflow', 'auto');
|
||||
this.instance = new GeminiScrollbar(this.options);
|
||||
this.create();
|
||||
this.element.data('scrollbar', this.instance);
|
||||
}
|
||||
|
||||
create() {
|
||||
this.instance.create();
|
||||
this.created = true;
|
||||
}
|
||||
|
||||
update() {
|
||||
if (typeof this.instance !== 'undefined') {
|
||||
this.instance.update();
|
||||
}
|
||||
if (!this.created) { return false; }
|
||||
this.instance.update();
|
||||
}
|
||||
|
||||
destroy() {
|
||||
if (!this.created) { return false; }
|
||||
this.instance.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class Sidebar {
|
||||
constructor() {
|
||||
this.isOpen = false;
|
||||
this.matchMedia = global.matchMedia(MOBILE_QUERY);
|
||||
this.scroller = new Scrollbar('#admin-menu', { autoshow: true });
|
||||
this.scroller = new Scrollbar('.admin-menu-wrapper', { autoshow: true });
|
||||
this.enable();
|
||||
}
|
||||
|
||||
|
||||
2
themes/grav/css-compiled/template.css
vendored
2
themes/grav/css-compiled/template.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
16
themes/grav/js/admin.min.js
vendored
16
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
6
themes/grav/js/vendor.min.js
vendored
6
themes/grav/js/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user