Fixed issue with touch devices and the new scrollbar

This commit is contained in:
Djamil Legato
2016-03-11 10:46:09 -08:00
parent 2c279d6341
commit ee7899eec8
6 changed files with 23 additions and 19 deletions

View File

@@ -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();
}
}

View File

@@ -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();
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long