Changeset 201692 in webkit
- Timestamp:
- Jun 4, 2016 5:59:40 PM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r201686 r201692 1 2016-06-04 Brian Burg <bburg@apple.com> 2 3 Web Inspector: add a keyboard shortcut to open the new tab tab 4 https://bugs.webkit.org/show_bug.cgi?id=158365 5 <rdar://problem/26631897> 6 7 Reviewed by Timothy Hatcher. 8 9 Make Cmd-t show the new tab tab if it's not already open and 10 there is at least one tab type that's not currently in the tab bar. 11 12 * UserInterface/Base/Main.js: 13 (WebInspector.contentLoaded): 14 (WebInspector._updateNewTabButtonState): 15 (WebInspector.showNewTabTab): 16 (WebInspector.isNewTabWithTypeAllowed): 17 Clean up the code that decides whether we can show the new tab tab. 18 It is now a special case inside WebInspector.isNewTabWithTypeAllowed. 19 20 * UserInterface/Views/NewTabContentView.js: 21 (WebInspector.NewTabContentView.prototype._updateShownTabs): 22 Use Array.from. 23 1 24 2016-06-04 Matt Baker <mattbaker@apple.com> 2 25 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r201620 r201692 269 269 270 270 this._showTabAtIndexKeyboardShortcuts = [1, 2, 3, 4, 5, 6, 7, 8, 9].map((i) => new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, `${i}`, this._showTabAtIndex.bind(this, i))); 271 this._openNewTabKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "T", this.showNewTabTab.bind(this)); 271 272 272 273 this.tabBrowser = new WebInspector.TabBrowser(document.getElementById("tab-browser"), this.tabBar, this.navigationSidebar, this.detailsSidebar); … … 521 522 WebInspector._updateNewTabButtonState = function(event) 522 523 { 523 let allTabs = [...this._knownTabClassesByType.values()]; 524 let addableTabs = allTabs.filter((tabClass) => !tabClass.isEphemeral()); 525 let canMakeNewTab = addableTabs.some((tabClass) => this.isNewTabWithTypeAllowed(tabClass.Type)); 526 this.tabBar.newTabItem.disabled = !canMakeNewTab; 524 this.tabBar.newTabItem.disabled = this.isNewTabWithTypeAllowed(WebInspector.NewTabContentView.Type); 527 525 }; 528 526 … … 563 561 WebInspector.showNewTabTab = function(shouldAnimate) 564 562 { 563 if (!this.isNewTabWithTypeAllowed(WebInspector.NewTabContentView.Type)) 564 return; 565 565 566 let tabContentView = this.tabBrowser.bestTabContentViewForClass(WebInspector.NewTabContentView); 566 567 if (!tabContentView) … … 582 583 if (tabContentView.constructor === tabClass) 583 584 return false; 585 } 586 587 if (tabClass === WebInspector.NewTabContentView) { 588 let allTabs = Array.from(this.knownTabClasses()); 589 let addableTabs = allTabs.filter((tabClass) => !tabClass.isEphemeral()); 590 let canMakeNewTab = addableTabs.some((tabClass) => WebInspector.isNewTabWithTypeAllowed(tabClass.Type)); 591 return canMakeNewTab; 584 592 } 585 593 -
trunk/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js
r193508 r201692 131 131 _updateShownTabs() 132 132 { 133 let allTabClasses = [...WebInspector.knownTabClasses()];133 let allTabClasses = Array.from(WebInspector.knownTabClasses()); 134 134 let allowedTabClasses = allTabClasses.filter((tabClass) => tabClass.isTabAllowed() && !tabClass.isEphemeral()); 135 135 allowedTabClasses.sort((a, b) => a.tabInfo().title.localeCompare(b.tabInfo().title));
Note: See TracChangeset
for help on using the changeset viewer.