Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1130)

Unified Diff: Source/devtools/front_end/ui/TabbedPane.js

Issue 1344283003: Devtools UI: Do not animate tab slider on load and during dragging (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/TabbedPane.js
diff --git a/Source/devtools/front_end/ui/TabbedPane.js b/Source/devtools/front_end/ui/TabbedPane.js
index c16a5e0c06733cc64f7bb65460214b809cb3a3e4..8e58e69f9cbe4739a75e7634bd8937e239102214 100644
--- a/Source/devtools/front_end/ui/TabbedPane.js
+++ b/Source/devtools/front_end/ui/TabbedPane.js
@@ -42,7 +42,7 @@ WebInspector.TabbedPane = function()
this._headerElement = this.contentElement.createChild("div", "tabbed-pane-header toolbar-colors");
this._headerElement.createChild("content").select = ".tabbed-pane-header-before";
this._headerContentsElement = this._headerElement.createChild("div", "tabbed-pane-header-contents");
- this._tabSlider = this._headerContentsElement.createChild("div", "tabbed-pane-tab-slider");
+ this._tabSlider = createElementWithClass("div", "tabbed-pane-tab-slider");
this._headerElement.createChild("content").select = ".tabbed-pane-header-after";
this._tabsElement = this._headerContentsElement.createChild("div", "tabbed-pane-header-tabs");
this._contentElement = this.contentElement.createChild("div", "tabbed-pane-content");
@@ -740,9 +740,7 @@ WebInspector.TabbedPane.prototype = {
_updateTabSlider: function()
{
- if (!this._currentTab)
- return;
- if (!this._sliderEnabled)
+ if (!this._currentTab || !this._sliderEnabled)
return;
var left = 0;
for (var i = 0; i < this._tabs.length && this._currentTab !== this._tabs[i] && this._tabs[i]._shown; i++)
@@ -750,6 +748,9 @@ WebInspector.TabbedPane.prototype = {
var sliderWidth = this._currentTab._shown ? this._currentTab._measuredWidth : this._dropDownButton.offsetWidth;
this._tabSlider.style.transform = "translateX(" + left + "px) scaleY(0.75)";
this._tabSlider.style.width = sliderWidth + "px";
+
+ if (this._tabSlider.parentElement !== this._headerContentsElement)
+ this._headerContentsElement.appendChild(this._tabSlider);
},
/**
@@ -1176,7 +1177,7 @@ WebInspector.TabbedPaneTab.prototype = {
this._tabElement.classList.add("dragging");
this._tabElement.style.setProperty("left", (event.pageX - this._dragStartX) + "px");
- this._tabbedPane._updateTabSlider();
+ this._tabbedPane._tabSlider.remove();
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698