Skip to content

Commit 456be0a

Browse files
colegoldsmithmarijnh
authored andcommitted
[dialog addon] Add class when dialog is open
1 parent a18d9f7 commit 456be0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

addon/dialog/dialog.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
} else { // Assuming it's a detached DOM element.
2626
dialog.appendChild(template);
2727
}
28+
CodeMirror.addClass(wrap, 'dialog-opened');
2829
return dialog;
2930
}
3031

@@ -47,6 +48,7 @@
4748
} else {
4849
if (closed) return;
4950
closed = true;
51+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
5052
dialog.parentNode.removeChild(dialog);
5153
me.focus();
5254

@@ -102,6 +104,7 @@
102104
function close() {
103105
if (closed) return;
104106
closed = true;
107+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
105108
dialog.parentNode.removeChild(dialog);
106109
me.focus();
107110
}
@@ -141,6 +144,7 @@
141144
if (closed) return;
142145
closed = true;
143146
clearTimeout(doneTimer);
147+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
144148
dialog.parentNode.removeChild(dialog);
145149
}
146150

0 commit comments

Comments
 (0)