Title: [103804] trunk/Source/WebCore
Revision
103804
Author
apav...@chromium.org
Date
2011-12-29 09:08:05 -0800 (Thu, 29 Dec 2011)

Log Message

Web Inspector: Suggest pop-over doesn't hide on tab switch
https://bugs.webkit.org/show_bug.cgi?id=73611

Reviewed by Pavel Feldman.

* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype.willHide):
* inspector/front-end/TextPrompt.js:
(WebInspector.TextPrompt.prototype.complete):
(WebInspector.TextPrompt.prototype._completionsReady):
(WebInspector.TextPrompt.prototype.acceptSuggestion):
(WebInspector.TextPrompt.prototype.hideSuggestBox):
(WebInspector.TextPrompt.SuggestBox.prototype._completionsReady):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (103803 => 103804)


--- trunk/Source/WebCore/ChangeLog	2011-12-29 17:02:43 UTC (rev 103803)
+++ trunk/Source/WebCore/ChangeLog	2011-12-29 17:08:05 UTC (rev 103804)
@@ -1,3 +1,19 @@
+2011-12-29  Alexander Pavlov  <apav...@chromium.org>
+
+        Web Inspector: Suggest pop-over doesn't hide on tab switch
+        https://bugs.webkit.org/show_bug.cgi?id=73611
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype.willHide):
+        * inspector/front-end/TextPrompt.js:
+        (WebInspector.TextPrompt.prototype.complete):
+        (WebInspector.TextPrompt.prototype._completionsReady):
+        (WebInspector.TextPrompt.prototype.acceptSuggestion):
+        (WebInspector.TextPrompt.prototype.hideSuggestBox):
+        (WebInspector.TextPrompt.SuggestBox.prototype._completionsReady):
+
 2011-12-28  Alexander Pavlov  <apav...@chromium.org>
 
         Web Inspector: Implement CSS selector profiler

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (103803 => 103804)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-12-29 17:02:43 UTC (rev 103803)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-12-29 17:08:05 UTC (rev 103804)
@@ -229,6 +229,12 @@
         }
     },
 
+    willHide: function()
+    {
+        this.prompt.hideSuggestBox();
+        this.prompt.clearAutoComplete(true);
+    },
+
     wasShown: function()
     {
         if (!this.prompt.isCaretInsidePrompt())

Modified: trunk/Source/WebCore/inspector/front-end/TextPrompt.js (103803 => 103804)


--- trunk/Source/WebCore/inspector/front-end/TextPrompt.js	2011-12-29 17:02:43 UTC (rev 103803)
+++ trunk/Source/WebCore/inspector/front-end/TextPrompt.js	2011-12-29 17:08:05 UTC (rev 103804)
@@ -359,8 +359,7 @@
                 shouldExit = true;
         }
         if (shouldExit) {
-            if (this.isSuggestBoxVisible())
-                this._suggestBox.hide();
+            this.hideSuggestBox();
             return;
         }
 
@@ -391,8 +390,7 @@
     _completionsReady: function(selection, auto, originalWordPrefixRange, reverse, completions)
     {
         if (!completions || !completions.length) {
-            if (this.isSuggestBoxVisible())
-                this._suggestBox.hide();
+            this.hideSuggestBox();
             return;
         }
 
@@ -535,13 +533,18 @@
         selection.removeAllRanges();
         selection.addRange(finalSelectionRange);
 
-        if (this._suggestBox)
-            this._suggestBox.hide();
+        this.hideSuggestBox();
         this.dispatchEventToListeners(WebInspector.TextPrompt.Events.ItemAccepted);
 
         return true;
     },
 
+    hideSuggestBox: function()
+    {
+        if (this.isSuggestBoxVisible())
+            this._suggestBox.hide();
+    },
+
     isSuggestBoxVisible: function()
     {
         return this._suggestBox && this._suggestBox.visible;
@@ -1107,7 +1110,7 @@
         this._updateItems(completions);
         this._updateBoxPosition(anchorBox);
         if (this.contentElement.children.length && this.contentElement.children.length > 1) {
-            // Will not be shown if a sole suggestion is equal to the user input.
+            // Will not be shown for a sole suggestion or no suggestions.
             this._element.addStyleClass("visible");
         } else
             this.hide();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to