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

Fix #5062: Update notification is no longer modal #5085

Merged
merged 4 commits into from
Sep 18, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/styles/brackets_patterns_override.less
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
.modal-backdrop {
opacity: 0;
}
.modal-backdrop:last-child {
.last-backdrop {
/* Only show the last modal backdrop */
opacity: 0.5;
}
Expand Down
11 changes: 8 additions & 3 deletions src/utils/UpdateNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ define(function (require, exports, module) {

var Dialogs = require("widgets/Dialogs"),
DefaultDialogs = require("widgets/DefaultDialogs"),
NativeApp = require("utils/NativeApp"),
PreferencesManager = require("preferences/PreferencesManager"),
Strings = require("strings"),
StringUtils = require("utils/StringUtils"),
AppInit = require("utils/AppInit"),
Global = require("utils/Global"),
NativeApp = require("utils/NativeApp"),
StringUtils = require("utils/StringUtils"),
Strings = require("strings"),
UpdateDialogTemplate = require("text!htmlContent/update-dialog.html"),
UpdateListTemplate = require("text!htmlContent/update-list.html");

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

updates.Strings = Strings;
$updateList.html(Mustache.render(UpdateListTemplate, updates));

AppInit.appReady(function () {
$dlg.find("button").focus();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to differ from the button-focusing logic in the "shown" handler. Should be hoisted out into a shared helper function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but this is only required when the dialog is opened before the app is ready, which will happen in very few places. Maybe we could just move the update notification logic to the app ready?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move the update notification logic to the app ready.

}

/**
Expand Down
9 changes: 7 additions & 2 deletions src/widgets/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ define(function (require, exports, module) {

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

// Remove our global keydown handler.
KeyBindingManager.removeGlobalKeydownHook(keydownHook);
Expand All @@ -273,7 +274,9 @@ define(function (require, exports, module) {
_dismissDialog($dlg, $(this).attr("data-button-id"));
});
}


$(".last-backdrop").removeClass("last-backdrop");

// Run the dialog
$dlg
.modal({
Expand All @@ -283,7 +286,9 @@ define(function (require, exports, module) {
})
// Updates the z-index of the modal dialog and the backdrop
.css("z-index", zIndex + 1)
.next().css("z-index", zIndex);
.next()
.css("z-index", zIndex)
.addClass("last-backdrop");

zIndex += 2;

Expand Down