Title: [117300] trunk/Source/WebCore
Revision
117300
Author
[email protected]
Date
2012-05-16 09:22:25 -0700 (Wed, 16 May 2012)

Log Message

Web Inspector: Double Clicking on "No watch expressions" should add an _expression_
https://bugs.webkit.org/show_bug.cgi?id=86631

Reviewed by Vsevolod Vlasov.

A double-click listener for the section element adds a new watch _expression_ if the correct element
has been clicked.
Drive-by: do not persist deleted (null) watch expressions.

* inspector/front-end/WatchExpressionsSidebarPane.js:
(WebInspector.WatchExpressionsSection.prototype._sectionDoubleClick):
(WebInspector.WatchExpressionsSection.prototype.updateExpression):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (117299 => 117300)


--- trunk/Source/WebCore/ChangeLog	2012-05-16 16:11:43 UTC (rev 117299)
+++ trunk/Source/WebCore/ChangeLog	2012-05-16 16:22:25 UTC (rev 117300)
@@ -1,3 +1,18 @@
+2012-05-16  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: Double Clicking on "No watch expressions" should add an _expression_
+        https://bugs.webkit.org/show_bug.cgi?id=86631
+
+        Reviewed by Vsevolod Vlasov.
+
+        A double-click listener for the section element adds a new watch _expression_ if the correct element
+        has been clicked.
+        Drive-by: do not persist deleted (null) watch expressions.
+
+        * inspector/front-end/WatchExpressionsSidebarPane.js:
+        (WebInspector.WatchExpressionsSection.prototype._sectionDoubleClick):
+        (WebInspector.WatchExpressionsSection.prototype.updateExpression):
+
 2012-05-16  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Support script snippets saving.

Modified: trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js (117299 => 117300)


--- trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js	2012-05-16 16:11:43 UTC (rev 117299)
+++ trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js	2012-05-16 16:22:25 UTC (rev 117300)
@@ -138,6 +138,7 @@
 
     this.element.addEventListener("mousemove", this._mouseMove.bind(this), true);
     this.element.addEventListener("mouseout", this._mouseOut.bind(this), true);
+    this.element.addEventListener("dblclick", this._sectionDoubleClick.bind(this), false);
 }
 
 WebInspector.WatchExpressionsSection.NewWatchExpression = "\xA0";
@@ -236,9 +237,20 @@
         this.update();
     },
 
+    _sectionDoubleClick: function(event)
+    {
+        if (event.target !== this.element && event.target !== this.propertiesElement && event.target !== this.emptyElement)
+            return;
+        event.consume();
+        this.addNewExpressionAndEdit();
+    },
+
     updateExpression: function(element, value)
     {
-        this.watchExpressions[element.property.watchIndex] = value;
+        if (value === null)
+            delete this.watchExpressions[element.property.watchIndex];
+        else
+            this.watchExpressions[element.property.watchIndex] = value;
         this.saveExpressions();
         this.update();
     },
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to