Skip to content

Commit a219dcd

Browse files
committed
Core: all modals have now "opened" prop
1 parent 11e3bae commit a219dcd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/core/components/modal/modal-class.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Modal extends Framework7Class {
2222
modal.useModulesParams(defaults);
2323

2424
modal.params = Utils.extend(defaults, params);
25+
modal.opened = false;
2526

2627
// Install Modules
2728
modal.useModules();
@@ -30,6 +31,7 @@ class Modal extends Framework7Class {
3031
}
3132
onOpen() {
3233
const modal = this;
34+
modal.opened = true;
3335
openedModals.push(modal);
3436
$('html').addClass(`with-modal-${modal.type.toLowerCase()}`);
3537
modal.$el.trigger(`modal:open ${modal.type.toLowerCase()}:open`, modal);
@@ -42,6 +44,7 @@ class Modal extends Framework7Class {
4244
}
4345
onClose() {
4446
const modal = this;
47+
modal.opened = false;
4548
if (!modal.type || !modal.$el) return;
4649
openedModals.splice(openedModals.indexOf(modal), 1);
4750
$('html').removeClass(`with-modal-${modal.type.toLowerCase()}`);

0 commit comments

Comments
 (0)