mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
close dialogs when clicking outside of the dialog container
This commit is contained in:
parent
4e515f4820
commit
dd58af30b9
@ -42,6 +42,8 @@
|
|||||||
|
|
||||||
// adding the .animated class here instead of in the markup to avoid an animation during app startup
|
// adding the .animated class here instead of in the markup to avoid an animation during app startup
|
||||||
this.dialogWrapper_.classList.add('animated');
|
this.dialogWrapper_.classList.add('animated');
|
||||||
|
pskl.utils.Event.addEventListener(this.dialogWrapper_, 'click', this.onWrapperClicked_, this);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.DialogsController.prototype.onCreatePaletteShortcut_ = function () {
|
ns.DialogsController.prototype.onCreatePaletteShortcut_ = function () {
|
||||||
@ -69,6 +71,12 @@
|
|||||||
this.showDialog(args.dialogId, args.initArgs);
|
this.showDialog(args.dialogId, args.initArgs);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ns.DialogsController.prototype.onWrapperClicked_ = function (evt) {
|
||||||
|
if (evt.target === this.dialogWrapper_) {
|
||||||
|
this.hideDialog();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
ns.DialogsController.prototype.showDialog = function (dialogId, initArgs) {
|
ns.DialogsController.prototype.showDialog = function (dialogId, initArgs) {
|
||||||
if (this.isDisplayingDialog_()) {
|
if (this.isDisplayingDialog_()) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user