mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
fix #392
Signed-off-by:Guillaume Martigny <guillaume.martigny@gmail.com>
This commit is contained in:
parent
c55a81f29b
commit
5eb936d8c2
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
ns.SettingsController = function (piskelController) {
|
ns.SettingsController = function (piskelController) {
|
||||||
this.piskelController = piskelController;
|
this.piskelController = piskelController;
|
||||||
|
this.closeDrawerShortcut = pskl.service.keyboard.Shortcuts.MISC.CLOSE_POPUP;
|
||||||
this.settingsContainer = document.querySelector('[data-pskl-controller=settings]');
|
this.settingsContainer = document.querySelector('[data-pskl-controller=settings]');
|
||||||
this.drawerContainer = document.getElementById('drawer-container');
|
this.drawerContainer = document.getElementById('drawer-container');
|
||||||
this.isExpanded = false;
|
this.isExpanded = false;
|
||||||
@ -87,6 +88,8 @@
|
|||||||
this.currentController = new settings[setting].controller(this.piskelController);
|
this.currentController = new settings[setting].controller(this.piskelController);
|
||||||
this.currentController.init();
|
this.currentController.init();
|
||||||
|
|
||||||
|
pskl.app.shortcutService.registerShortcut(this.closeDrawerShortcut, this.closeDrawer_.bind(this));
|
||||||
|
|
||||||
pskl.utils.Dom.removeClass(SEL_SETTING_CLS);
|
pskl.utils.Dom.removeClass(SEL_SETTING_CLS);
|
||||||
var selectedSettingButton = document.querySelector('[data-setting=' + setting + ']');
|
var selectedSettingButton = document.querySelector('[data-setting=' + setting + ']');
|
||||||
if (selectedSettingButton) {
|
if (selectedSettingButton) {
|
||||||
@ -109,9 +112,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ns.SettingsController.prototype.destroyCurrentController_ = function () {
|
ns.SettingsController.prototype.destroyCurrentController_ = function () {
|
||||||
if (this.currentController && this.currentController.destroy) {
|
if (this.currentController) {
|
||||||
this.currentController.destroy();
|
pskl.app.shortcutService.unregisterShortcut(this.closeDrawerShortcut);
|
||||||
this.currentController = null;
|
if (this.currentController.destroy) {
|
||||||
|
this.currentController.destroy();
|
||||||
|
this.currentController = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user