WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
[PATCH] For Landing
better-4.patch (text/plain), 3.96 KB, created by
Joseph Pecoraro
on 2015-05-28 16:16:44 PDT
(
hide
)
Description:
[PATCH] For Landing
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2015-05-28 16:16:44 PDT
Size:
3.96 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 4d30296..6ef0ffd 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,5 +1,26 @@ > 2015-05-28 Joseph Pecoraro <pecoraro@apple.com> > >+ Web Inspector: NewTabContentView should update button disabled state as other tabs are added/removed >+ https://bugs.webkit.org/show_bug.cgi?id=145448 >+ >+ Reviewed by Timothy Hatcher. >+ >+ * UserInterface/Views/NewTabContentView.js: >+ (WebInspector.NewTabContentView): >+ Always add a click listener and add the type as a private property on the element. >+ >+ (WebInspector.NewTabContentView.prototype.shown): >+ (WebInspector.NewTabContentView.prototype.hidden): >+ Add / remove event listeners for tab changes. Also update the view when shown. >+ >+ (WebInspector.NewTabContentView.prototype._createNewTab): >+ A disabled button an now be clicked. Do nothing if a new tab of this type is not allowed. >+ >+ (WebInspector.NewTabContentView.prototype._updateTabItems): >+ Refresh the disabled state for each of the buttons. >+ >+2015-05-28 Joseph Pecoraro <pecoraro@apple.com> >+ > Web Inspector: Tabs should have Context Menus > https://bugs.webkit.org/show_bug.cgi?id=144208 > >diff --git a/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js b/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js >index 1798a67..536645f 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js >@@ -43,12 +43,9 @@ WebInspector.NewTabContentView = function(identifier) > continue; > > var tabItemElement = document.createElement("div"); >- tabItemElement.classList.add("tab-item"); >- >- if (WebInspector.isNewTabWithTypeAllowed(info.type)) >- tabItemElement.addEventListener("click", this._createNewTab.bind(this, info.type)); >- else >- tabItemElement.classList.add("disabled"); >+ tabItemElement.classList.add(WebInspector.NewTabContentView.TabItemStyleClassName); >+ tabItemElement.addEventListener("click", this._createNewTab.bind(this, info.type)); >+ tabItemElement[WebInspector.NewTabContentView.TypeSymbol] = info.type; > > var boxElement = tabItemElement.appendChild(document.createElement("div")); > boxElement.classList.add("box"); >@@ -74,12 +71,42 @@ WebInspector.NewTabContentView.prototype = { > return WebInspector.NewTabContentView.Type; > }, > >+ shown() >+ { >+ WebInspector.tabBrowser.tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemAdded, this._updateTabItems, this); >+ WebInspector.tabBrowser.tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemRemoved, this._updateTabItems, this); >+ >+ this._updateTabItems(); >+ }, >+ >+ hidden() >+ { >+ WebInspector.tabBrowser.tabBar.removeEventListener(null, null, this); >+ }, >+ > // Private > >- _createNewTab: function(tabType, event) >+ _createNewTab(tabType, event) > { >+ if (!WebInspector.isNewTabWithTypeAllowed(tabType)) >+ return; >+ > WebInspector.createNewTab(tabType, this); >+ }, >+ >+ _updateTabItems() >+ { >+ var tabItemElements = Array.from(this.element.querySelectorAll("." + WebInspector.NewTabContentView.TabItemStyleClassName)); >+ for (var tabItemElement of tabItemElements) { >+ var type = tabItemElement[WebInspector.NewTabContentView.TypeSymbol]; >+ var allowed = WebInspector.isNewTabWithTypeAllowed(type); >+ tabItemElement.classList.toggle(WebInspector.NewTabContentView.DisabledStyleClassName, !allowed); >+ } > } > }; > > WebInspector.NewTabContentView.Type = "new-tab"; >+WebInspector.NewTabContentView.TypeSymbol = Symbol("type"); >+ >+WebInspector.NewTabContentView.TabItemStyleClassName = "tab-item"; >+WebInspector.NewTabContentView.DisabledStyleClassName = "disabled";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 145448
:
253872
| 253874