Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit f4101ce

Browse files
committed
Fixes the modal backdrop
1 parent 25ec9fd commit f4101ce

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/styles/brackets_patterns_override.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@
451451
.modal-backdrop {
452452
opacity: 0;
453453
}
454-
.modal-backdrop:last-child {
454+
.last-backdrop {
455455
/* Only show the last modal backdrop */
456456
opacity: 0.5;
457457
}

src/utils/UpdateNotification.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ define(function (require, exports, module) {
3333

3434
var Dialogs = require("widgets/Dialogs"),
3535
DefaultDialogs = require("widgets/DefaultDialogs"),
36-
NativeApp = require("utils/NativeApp"),
3736
PreferencesManager = require("preferences/PreferencesManager"),
38-
Strings = require("strings"),
39-
StringUtils = require("utils/StringUtils"),
37+
AppInit = require("utils/AppInit"),
4038
Global = require("utils/Global"),
39+
NativeApp = require("utils/NativeApp"),
40+
StringUtils = require("utils/StringUtils"),
41+
Strings = require("strings"),
4142
UpdateDialogTemplate = require("text!htmlContent/update-dialog.html"),
4243
UpdateListTemplate = require("text!htmlContent/update-list.html");
4344

@@ -208,6 +209,10 @@ define(function (require, exports, module) {
208209

209210
updates.Strings = Strings;
210211
$updateList.html(Mustache.render(UpdateListTemplate, updates));
212+
213+
AppInit.appReady(function () {
214+
$dlg.find("button").focus();
215+
});
211216
}
212217

213218
/**

src/widgets/Dialogs.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ define(function (require, exports, module) {
252252

253253
// Remove the dialog instance from the DOM.
254254
$dlg.remove();
255+
$(".modal-backdrop:last").addClass("last-backdrop");
255256

256257
// Remove our global keydown handler.
257258
KeyBindingManager.removeGlobalKeydownHook(keydownHook);
@@ -273,7 +274,9 @@ define(function (require, exports, module) {
273274
_dismissDialog($dlg, $(this).attr("data-button-id"));
274275
});
275276
}
276-
277+
278+
$(".last-backdrop").removeClass("last-backdrop");
279+
277280
// Run the dialog
278281
$dlg
279282
.modal({
@@ -283,7 +286,9 @@ define(function (require, exports, module) {
283286
})
284287
// Updates the z-index of the modal dialog and the backdrop
285288
.css("z-index", zIndex + 1)
286-
.next().css("z-index", zIndex);
289+
.next()
290+
.css("z-index", zIndex)
291+
.addClass("last-backdrop");
287292

288293
zIndex += 2;
289294

0 commit comments

Comments
 (0)