Title: [222405] trunk/Source/WebInspectorUI
Revision
222405
Author
[email protected]
Date
2017-09-22 14:08:27 -0700 (Fri, 22 Sep 2017)

Log Message

Web Inspector: NavigationBar should coalesce consecutive dividers when items are hidden
https://bugs.webkit.org/show_bug.cgi?id=177379

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype.layout):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (222404 => 222405)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-09-22 21:07:23 UTC (rev 222404)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-09-22 21:08:27 UTC (rev 222405)
@@ -1,3 +1,13 @@
+2017-09-22  Matt Baker  <[email protected]>
+
+        Web Inspector: NavigationBar should coalesce consecutive dividers when items are hidden
+        https://bugs.webkit.org/show_bug.cgi?id=177379
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/NavigationBar.js:
+        (WI.NavigationBar.prototype.layout):
+
 2017-09-22  Tim Horton  <[email protected]>
 
         Add env() as an alias of constant()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js (222404 => 222405)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2017-09-22 21:07:23 UTC (rev 222404)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2017-09-22 21:08:27 UTC (rev 222405)
@@ -249,21 +249,21 @@
             item.updateLayout(false);
 
         totalItemWidth = calculateVisibleItemWidth();
-        if (totalItemWidth <= barWidth)
-            return;
 
-        // Hide visible items, starting with the lowest priority item, until the
-        // bar fits the available width.
-        visibleNavigationItems.sort((a, b) => a.visibilityPriority - b.visibilityPriority);
+        if (totalItemWidth > barWidth) {
+            // Hide visible items, starting with the lowest priority item, until
+            // the bar fits the available width.
+            visibleNavigationItems.sort((a, b) => a.visibilityPriority - b.visibilityPriority);
 
-        while (totalItemWidth > barWidth && visibleNavigationItems.length) {
-            let navigationItem = visibleNavigationItems.shift();
-            totalItemWidth -= navigationItem.width;
-            forceItemHidden(navigationItem, true);
+            while (totalItemWidth > barWidth && visibleNavigationItems.length) {
+                let navigationItem = visibleNavigationItems.shift();
+                totalItemWidth -= navigationItem.width;
+                forceItemHidden(navigationItem, true);
+            }
+
+            visibleNavigationItems = this._visibleNavigationItems;
         }
 
-        visibleNavigationItems = this._visibleNavigationItems;
-
         // Hide leading, trailing, and consecutive dividers.
         let previousItem = null;
         for (let item of visibleNavigationItems) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to