Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 else | 482 else |
| 483 constraints = constraints.addHeight(new UI.Constraints(new UI.Size(0, 30)) ); | 483 constraints = constraints.addHeight(new UI.Constraints(new UI.Size(0, 30)) ); |
| 484 return constraints; | 484 return constraints; |
| 485 } | 485 } |
| 486 | 486 |
| 487 _updateTabElements() { | 487 _updateTabElements() { |
| 488 UI.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElements); | 488 UI.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElements); |
| 489 } | 489 } |
| 490 | 490 |
| 491 /** | 491 /** |
| 492 * @param {string} text | 492 * @param {!Element} element |
| 493 */ | 493 */ |
| 494 setPlaceholderText(text) { | 494 setPlaceholderElement(element) { |
| 495 this._noTabsMessage = text; | 495 this._noTabsMessageElement = element; |
| 496 element.classList.add('fill'); | |
|
pfeldman
2017/03/28 00:59:35
You should not add classes to provided elements -
luoe
2017/04/22 00:07:03
Consistency sounds great to me, I'll keep it in th
| |
| 496 } | 497 } |
| 497 | 498 |
| 498 _innerUpdateTabElements() { | 499 _innerUpdateTabElements() { |
| 499 if (!this.isShowing()) | 500 if (!this.isShowing()) |
| 500 return; | 501 return; |
| 501 | 502 |
| 502 if (!this._tabs.length) { | 503 if (!this._tabs.length) { |
| 503 this._contentElement.classList.add('has-no-tabs'); | 504 this._contentElement.classList.add('has-no-tabs'); |
| 504 if (this._noTabsMessage && !this._noTabsMessageElement) { | 505 if (this._noTabsMessageElement) |
| 505 this._noTabsMessageElement = this._contentElement.createChild('div', 'ta bbed-pane-placeholder fill'); | 506 this.element.appendChild(this._noTabsMessageElement); |
| 506 this._noTabsMessageElement.textContent = this._noTabsMessage; | |
| 507 } | |
| 508 } else { | 507 } else { |
| 509 this._contentElement.classList.remove('has-no-tabs'); | 508 this._contentElement.classList.remove('has-no-tabs'); |
| 510 if (this._noTabsMessageElement) { | 509 if (this._noTabsMessageElement) |
| 511 this._noTabsMessageElement.remove(); | 510 this._noTabsMessageElement.remove(); |
| 512 delete this._noTabsMessageElement; | |
| 513 } | |
| 514 } | 511 } |
| 515 | 512 |
| 516 this._measureDropDownButton(); | 513 this._measureDropDownButton(); |
| 517 this._updateWidths(); | 514 this._updateWidths(); |
| 518 this._updateTabsDropDown(); | 515 this._updateTabsDropDown(); |
| 519 this._updateTabSlider(); | 516 this._updateTabSlider(); |
| 520 } | 517 } |
| 521 | 518 |
| 522 /** | 519 /** |
| 523 * @param {number} index | 520 * @param {number} index |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1222 * @param {!Array.<string>} ids | 1219 * @param {!Array.<string>} ids |
| 1223 */ | 1220 */ |
| 1224 closeTabs(tabbedPane, ids) {}, | 1221 closeTabs(tabbedPane, ids) {}, |
| 1225 | 1222 |
| 1226 /** | 1223 /** |
| 1227 * @param {string} tabId | 1224 * @param {string} tabId |
| 1228 * @param {!UI.ContextMenu} contextMenu | 1225 * @param {!UI.ContextMenu} contextMenu |
| 1229 */ | 1226 */ |
| 1230 onContextMenu(tabId, contextMenu) {} | 1227 onContextMenu(tabId, contextMenu) {} |
| 1231 }; | 1228 }; |
| OLD | NEW |