Fixes: U4-7629 Help-dialog doesn't open, when user-dialog is open

This commit is contained in:
Mads Rasmussen
2016-01-05 11:46:02 +01:00
parent 69233fbead
commit cd66bbfb0f
2 changed files with 44 additions and 33 deletions

View File

@@ -88,44 +88,54 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
scope.avatarClick = function(){
if(scope.helpDialog) {
closeHelpDialog();
}
if(!scope.userDialog) {
scope.userDialog = {};
scope.userDialog.view = "user";
scope.userDialog.show = true;
scope.userDialog.close = function(oldModel) {
scope.userDialog.show = false;
scope.userDialog = null;
scope.userDialog = {
view: "user",
show: true,
close: function(oldModel) {
closeUserDialog();
}
};
} else {
scope.userDialog.show = false;
scope.userDialog = null;
closeUserDialog();
}
};
function closeUserDialog() {
scope.userDialog.show = false;
scope.userDialog = null;
}
scope.helpClick = function(){
if(scope.userDialog) {
closeUserDialog();
}
if(!scope.helpDialog) {
scope.helpDialog = {};
scope.helpDialog.show = true;
scope.helpDialog.view = "help";
scope.helpDialog.close = function(oldModel) {
scope.helpDialog.show = false;
scope.helpDialog = null;
scope.helpDialog = {
view: "help",
show: true,
close: function(oldModel) {
closeHelpDialog();
}
};
} else {
scope.helpDialog.show = false;
scope.helpDialog = null;
closeHelpDialog();
}
};
function closeHelpDialog() {
scope.helpDialog.show = false;
scope.helpDialog = null;
}
scope.sectionClick = function (event, section) {
if (event.ctrlKey ||
@@ -136,12 +146,11 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
return;
}
if (navigationService.userDialog) {
navigationService.userDialog.close();
if (scope.userDialog) {
closeUserDialog();
}
if (navigationService.helpDialog) {
navigationService.helpDialog.close();
if (scope.helpDialog) {
closeHelpDialog();
}
navigationService.hideSearch();
@@ -155,11 +164,11 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
scope.trayClick = function () {
// close dialogs
if (navigationService.userDialog) {
navigationService.userDialog.close();
if (scope.userDialog) {
closeUserDialog();
}
if (navigationService.helpDialog) {
navigationService.helpDialog.close();
if (scope.helpDialog) {
closeHelpDialog();
}
if (appState.getGlobalState("showTray") === true) {

View File

@@ -23,8 +23,6 @@
setButtonText();
registerOverlay();
modelCopy = makeModelCopy(scope.model);
$timeout(function() {
@@ -33,6 +31,10 @@
setTargetPosition();
}
// this has to be done inside a timeout to ensure the destroy
// event on other overlays is run before registering a new one
registerOverlay();
setOverlayIndent();
});