Skip to content

Commit 9a1c4f4

Browse files
author
Miguel Castillo
committed
Added logic to prevent closing the mixed tabs UI when clicking on the document
1 parent f6e8605 commit 9a1c4f4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

html/notification.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<div class="btn-group">
44
<button class="btn" id="yes-sanitize">Yes</button>
55
<button class="btn" id="no-sanitize">No</button>
6-
<button class="btn" id="disable-sanitize">Dont show this again</button>
6+
<button class="btn" id="disable-sanitize">Don't show this again</button>
77
</div>
88
</div>

main.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ define(function (require) {
8383
}
8484

8585

86+
var modalBar;
8687
function handleDocumentOpen(evt, editor) {
8788
if (!editor || prefs.get("onopen") !== true) {
8889
return;
@@ -92,12 +93,18 @@ define(function (require) {
9293
var settings = getPreferences(doc);
9394

9495
if (sanitize.verify(doc, settings.useTabChar, settings.size)) {
96+
if (modalBar) {
97+
modalBar.close();
98+
}
9599
return;
96100
}
97101

98102
setTimeout(function() {
99-
var modalBar = new ModalBar(notificationTmpl, true);
103+
if (modalBar) {
104+
modalBar.close();
105+
}
100106

107+
modalBar = new ModalBar(notificationTmpl, false);
101108
modalBar.getRoot()
102109
.on('click', '#yes-sanitize', function() {
103110
modalBar.close();

0 commit comments

Comments
 (0)