Title: [202082] trunk/Source/WebInspectorUI
Revision
202082
Author
[email protected]
Date
2016-06-14 19:52:35 -0700 (Tue, 14 Jun 2016)

Log Message

Web Inspector: Rename DataGrid.showColumn to setColumnVisible
https://bugs.webkit.org/show_bug.cgi?id=158764
<rdar://problem/26801448>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid):
Drive-by update to initialize "this._columnChooserEnabled".

(WebInspector.DataGrid.prototype.set identifier):
(WebInspector.DataGrid.prototype.insertColumn):
(WebInspector.DataGrid.prototype._collapseColumnGroupWithCell):
Use new method name.

(WebInspector.DataGrid.prototype._contextMenuInHeader):
Drive-by style update.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (202081 => 202082)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-06-15 02:52:10 UTC (rev 202081)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-06-15 02:52:35 UTC (rev 202082)
@@ -1,5 +1,25 @@
 2016-06-14  Matt Baker  <[email protected]>
 
+        Web Inspector: Rename DataGrid.showColumn to setColumnVisible
+        https://bugs.webkit.org/show_bug.cgi?id=158764
+        <rdar://problem/26801448>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/DataGrid.js:
+        (WebInspector.DataGrid):
+        Drive-by update to initialize "this._columnChooserEnabled".
+
+        (WebInspector.DataGrid.prototype.set identifier):
+        (WebInspector.DataGrid.prototype.insertColumn):
+        (WebInspector.DataGrid.prototype._collapseColumnGroupWithCell):
+        Use new method name.
+
+        (WebInspector.DataGrid.prototype._contextMenuInHeader):
+        Drive-by style update.
+
+2016-06-14  Matt Baker  <[email protected]>
+
         Web Inspector: Storage tab should allow hiding columns in the cookies grid
         https://bugs.webkit.org/show_bug.cgi?id=158767
         <rdar://problem/26803568>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js (202081 => 202082)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js	2016-06-15 02:52:10 UTC (rev 202081)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js	2016-06-15 02:52:35 UTC (rev 202082)
@@ -38,6 +38,7 @@
         this._sortOrder = WebInspector.DataGrid.SortOrder.Indeterminate;
         this._sortOrderSetting = null;
         this._hiddenColumnSetting = null;
+        this._columnChooserEnabled = false;
 
         this._rows = [];
 
@@ -226,7 +227,7 @@
             return;
 
         for (let columnIdentifier of this._hiddenColumnSetting.value)
-            this.showColumn(columnIdentifier, false);
+            this.setColumnVisible(columnIdentifier, false);
     }
 
     get columnChooserEnabled() { return this._columnChooserEnabled; }
@@ -769,7 +770,7 @@
 
         listeners.install();
 
-        this.showColumn(columnIdentifier, !column.hidden);
+        this.setColumnVisible(columnIdentifier, !column.hidden);
     }
 
     removeColumn(columnIdentifier)
@@ -908,7 +909,7 @@
         return !this.columns.get(columnIdentifier)["hidden"];
     }
 
-    showColumn(columnIdentifier, visible)
+    setColumnVisible(columnIdentifier, visible)
     {
         let column = this.columns.get(columnIdentifier);
         console.assert(column, "Missing column info for identifier: " + columnIdentifier);
@@ -1539,7 +1540,7 @@
 
         for (var [identifier, column] of this.columns) {
             if (column["group"] === cell.collapsesGroup)
-                this.showColumn(identifier, !columnsWillCollapse);
+                this.setColumnVisible(identifier, !columnsWillCollapse);
         }
 
         var collapserButton = cell.querySelector(".collapser-button");
@@ -1625,21 +1626,20 @@
             }
         }
 
-        if (!this._columnChooserEnabled)
-            return;
+        if (this._columnChooserEnabled) {
+            let didAddSeparator = false;
 
-        let didAddSeparator = false;
+            for (let [identifier, columnInfo] of this.columns) {
+                if (columnInfo.locked)
+                    continue;
 
-        for (let [identifier, columnInfo] of this.columns) {
-            if (columnInfo.locked)
-                continue;
+                if (!didAddSeparator) {
+                    contextMenu.appendSeparator();
+                    didAddSeparator = true;
+                }
 
-            if (!didAddSeparator) {
-                contextMenu.appendSeparator();
-                didAddSeparator = true;
+                contextMenu.appendCheckboxItem(columnInfo.title, () => { this.setColumnVisible(identifier, columnInfo.hidden); }, !columnInfo.hidden);
             }
-
-            contextMenu.appendCheckboxItem(columnInfo.title, () => { this.showColumn(identifier, columnInfo.hidden); }, !columnInfo.hidden);
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to