Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 0 additions & 2 deletions src/extensionsIntegrated/RecentProjects/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ define(function (require, exports, module) {
$("#titlebar .nav").off("click", closeDropdown);
$dropdown = null;

MainViewManager.focusActivePane();

$(window).off("keydown", keydownHook);
searchStr = "";
}
Expand Down
19 changes: 10 additions & 9 deletions src/widgets/PopUpManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ define(function (require, exports, module) {
MainViewManager = require("view/MainViewManager"),
KeyEvent = require("utils/KeyEvent");

let _popUps = [];
let _popUps = [], addPopupInProgress = false;

/**
* Add Esc key handling for a popup DOM element.
Expand All @@ -53,6 +53,7 @@ define(function (require, exports, module) {
function addPopUp($popUp, removeHandler, autoRemove, options) {
autoRemove = autoRemove || false;
options = options || {};
addPopupInProgress = true;
if(options.closeCurrentPopups) {
closeAllPopups();
}
Expand All @@ -62,6 +63,7 @@ define(function (require, exports, module) {
$popUp.data("PopUpManager-autoRemove", autoRemove);
$popUp.data("PopUpManager-popupManagesFocus", popupManagesFocus);
$popUp.data("PopUpManager-removeHandler", removeHandler);
addPopupInProgress = false;
}

/**
Expand All @@ -79,6 +81,13 @@ define(function (require, exports, module) {
removeHandler();
}
}
let popupManagesFocus = $popUp.data("PopUpManager-popupManagesFocus");
if(!popupManagesFocus && !addPopupInProgress){
// We need to have a focus manager to correctly manage focus
// between editors and other UI elements.
// For now we set focus here if the popup doesnt manage the focus itself
MainViewManager.focusActivePane();
}

// check index after removeHandler is done processing to protect
// against recursive calls
Expand Down Expand Up @@ -116,15 +125,7 @@ define(function (require, exports, module) {
keyEvent.stopImmediatePropagation();
}

let popupManagesFocus = $popUp.data("PopUpManager-popupManagesFocus");
removePopUp($popUp);

if(!popupManagesFocus){
// We need to have a focus manager to correctly manage focus
// between editors and other UI elements.
// For now we set focus here if the popup doesnt manage the focus itself
MainViewManager.focusActivePane();
}
}

break;
Expand Down
Loading