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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js

Issue 2867133002: DevTools: Let the drawer tabs be reordered (Closed)
Patch Set: Add test Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 */ 797 */
798 elementsToRestoreScrollPositionsFor() { 798 elementsToRestoreScrollPositionsFor() {
799 return [this._contentElement]; 799 return [this._contentElement];
800 } 800 }
801 801
802 /** 802 /**
803 * @param {!UI.TabbedPaneTab} tab 803 * @param {!UI.TabbedPaneTab} tab
804 * @param {number} index 804 * @param {number} index
805 */ 805 */
806 _insertBefore(tab, index) { 806 _insertBefore(tab, index) {
807 this._tabsElement.insertBefore(tab._tabElement || null, this._tabsElement.ch ildNodes[index]); 807 this._tabsElement.insertBefore(tab.tabElement, this._tabsElement.childNodes[ index]);
einbinder 2017/05/23 00:12:25 _tabElement could be null, but insertBefore actual
808 var oldIndex = this._tabs.indexOf(tab); 808 var oldIndex = this._tabs.indexOf(tab);
809 this._tabs.splice(oldIndex, 1); 809 this._tabs.splice(oldIndex, 1);
810 if (oldIndex < index) 810 if (oldIndex < index)
811 --index; 811 --index;
812 this._tabs.splice(index, 0, tab); 812 this._tabs.splice(index, 0, tab);
813 this.dispatchEventToListeners(UI.TabbedPane.Events.TabOrderChanged, this._ta bs); 813 this.dispatchEventToListeners(UI.TabbedPane.Events.TabOrderChanged, this._ta bs);
814 } 814 }
815 815
816 /** 816 /**
817 * @return {!UI.Toolbar} 817 * @return {!UI.Toolbar}
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 /** 1027 /**
1028 * @param {boolean} measuring 1028 * @param {boolean} measuring
1029 * @return {!Element} 1029 * @return {!Element}
1030 */ 1030 */
1031 _createTabElement(measuring) { 1031 _createTabElement(measuring) {
1032 var tabElement = createElementWithClass('div', 'tabbed-pane-header-tab'); 1032 var tabElement = createElementWithClass('div', 'tabbed-pane-header-tab');
1033 tabElement.id = 'tab-' + this._id; 1033 tabElement.id = 'tab-' + this._id;
1034 tabElement.tabIndex = -1; 1034 tabElement.tabIndex = -1;
1035 UI.ARIAUtils.markAsTab(tabElement); 1035 UI.ARIAUtils.markAsTab(tabElement);
1036 UI.ARIAUtils.setSelected(tabElement, false); 1036 UI.ARIAUtils.setSelected(tabElement, false);
1037 tabElement.selectTabForTest = this._tabbedPane.selectTab.bind(this._tabbedPa ne, this.id, true);
einbinder 2017/05/23 00:12:25 This was unused.
1038 1037
1039 var titleElement = tabElement.createChild('span', 'tabbed-pane-header-tab-ti tle'); 1038 var titleElement = tabElement.createChild('span', 'tabbed-pane-header-tab-ti tle');
1040 titleElement.textContent = this.title; 1039 titleElement.textContent = this.title;
1041 titleElement.title = this.tooltip || ''; 1040 titleElement.title = this.tooltip || '';
1042 this._createIconElement(tabElement, titleElement, measuring); 1041 this._createIconElement(tabElement, titleElement, measuring);
1043 if (!measuring) 1042 if (!measuring)
1044 this._titleElement = titleElement; 1043 this._titleElement = titleElement;
1045 1044
1046 if (this._closeable) 1045 if (this._closeable)
1047 tabElement.createChild('div', 'tabbed-pane-close-button', 'dt-close-button ').gray = true; 1046 tabElement.createChild('div', 'tabbed-pane-close-button', 'dt-close-button ').gray = true;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 * @param {!Array.<string>} ids 1224 * @param {!Array.<string>} ids
1226 */ 1225 */
1227 closeTabs(tabbedPane, ids) {}, 1226 closeTabs(tabbedPane, ids) {},
1228 1227
1229 /** 1228 /**
1230 * @param {string} tabId 1229 * @param {string} tabId
1231 * @param {!UI.ContextMenu} contextMenu 1230 * @param {!UI.ContextMenu} contextMenu
1232 */ 1231 */
1233 onContextMenu(tabId, contextMenu) {} 1232 onContextMenu(tabId, contextMenu) {}
1234 }; 1233 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698