aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Luong2013-06-19 23:00:59 (EDT)
committerMark Macdonald2013-06-21 12:00:30 (EDT)
commit884722d6c58accb6a4f8aabad2bebf2944872a27 (patch)
tree276afb5ad2d2037284fd0384c12509f31f874d08
parent710401951b5a08e2aa14b3ba203daa3fcb6bec1a (diff)
downloadorg.eclipse.orion.client-884722d6c58accb6a4f8aabad2bebf2944872a27.zip
org.eclipse.orion.client-884722d6c58accb6a4f8aabad2bebf2944872a27.tar.gz
org.eclipse.orion.client-884722d6c58accb6a4f8aabad2bebf2944872a27.tar.bz2
Bug 411068 - [Dialog] Multiple dialogs can be created and renders the dialog unusable
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js6
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js6
2 files changed, 12 insertions, 0 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js
index 624daab..0a5f964 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js
@@ -95,6 +95,7 @@ define([
// global search
if (self._searcher) {
+ var showingSearchDialog = false;
var searchCommand = new mCommands.Command({
name: messages["Search Files"],
tooltip: messages["Search Files"],
@@ -108,6 +109,9 @@ define([
editor.getTextView().setKeyBinding(new mKeyBinding.KeyBinding("h", true), "searchFiles"); //$NON-NLS-1$ //$NON-NLS-0$
editor.getTextView().setAction("searchFiles", function() { //$NON-NLS-0$
+ if (showingSearchDialog) {
+ return;
+ }
var selection = editor.getSelection();
var searchTerm = editor.getText(selection.start, selection.end);
var serviceRegistry = self.serviceRegistry;
@@ -123,12 +127,14 @@ define([
message: messages["Enter search term:"],
initialText: searchTerm,
onHide: function () {
+ showingSearchDialog = false;
if (editor && editor.getTextView()) {
editor.getTextView().focus();
}
}
});
window.setTimeout(function () {
+ showingSearchDialog = true;
dialog.show(lib.node(self.toolbarId));
}, 0);
return true;
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
index 4b5feae..71cb47e 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
@@ -698,8 +698,12 @@ define([
commandRegistry.addCommand(favoriteCommand);
// open resource
+ var showingResourceDialog = false;
var openResourceDialog = function (searcher, serviceRegistry, /* optional */
editor) {
+ if (showingResourceDialog) {
+ return;
+ }
var favoriteService = serviceRegistry.getService("orion.core.favorite"); //$NON-NLS-0$
var progress = serviceRegistry.getService("orion.page.progress"); //$NON-NLS-0$
// TODO Shouldn't really be making service selection decisions at this level. See bug 337740
@@ -716,12 +720,14 @@ define([
searchRenderer: searcher.defaultRenderer,
favoriteService: favoriteService,
onHide: function () {
+ showingResourceDialog = false;
if (editor && editor.getTextView()) {
editor.getTextView().focus();
}
}
});
window.setTimeout(function () {
+ showingResourceDialog = true;
dialog.show();
}, 0);
};