| 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._placeholderElement = element; |
| 496 |
| 497 if (this._placeholderContainerElement) { |
| 498 this._placeholderContainerElement.removeChildren(); |
| 499 this._placeholderContainerElement.appendChild(element); |
| 500 } |
| 496 } | 501 } |
| 497 | 502 |
| 498 _innerUpdateTabElements() { | 503 _innerUpdateTabElements() { |
| 499 if (!this.isShowing()) | 504 if (!this.isShowing()) |
| 500 return; | 505 return; |
| 501 | 506 |
| 502 if (!this._tabs.length) { | 507 if (!this._tabs.length) { |
| 503 this._contentElement.classList.add('has-no-tabs'); | 508 this._contentElement.classList.add('has-no-tabs'); |
| 504 if (this._noTabsMessage && !this._noTabsMessageElement) { | 509 if (this._placeholderElement && !this._placeholderContainerElement) { |
| 505 this._noTabsMessageElement = this._contentElement.createChild('div', 'ta
bbed-pane-placeholder fill'); | 510 this._placeholderContainerElement = this._contentElement.createChild('di
v', 'tabbed-pane-placeholder fill'); |
| 506 this._noTabsMessageElement.textContent = this._noTabsMessage; | 511 this._placeholderContainerElement.appendChild(this._placeholderElement); |
| 507 } | 512 } |
| 508 } else { | 513 } else { |
| 509 this._contentElement.classList.remove('has-no-tabs'); | 514 this._contentElement.classList.remove('has-no-tabs'); |
| 510 if (this._noTabsMessageElement) { | 515 if (this._placeholderContainerElement) { |
| 511 this._noTabsMessageElement.remove(); | 516 this._placeholderContainerElement.remove(); |
| 512 delete this._noTabsMessageElement; | 517 delete this._placeholderContainerElement; |
| 513 } | 518 } |
| 514 } | 519 } |
| 515 | 520 |
| 516 this._measureDropDownButton(); | 521 this._measureDropDownButton(); |
| 517 this._updateWidths(); | 522 this._updateWidths(); |
| 518 this._updateTabsDropDown(); | 523 this._updateTabsDropDown(); |
| 519 this._updateTabSlider(); | 524 this._updateTabSlider(); |
| 520 } | 525 } |
| 521 | 526 |
| 522 /** | 527 /** |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 * @param {!Array.<string>} ids | 1225 * @param {!Array.<string>} ids |
| 1221 */ | 1226 */ |
| 1222 closeTabs(tabbedPane, ids) {}, | 1227 closeTabs(tabbedPane, ids) {}, |
| 1223 | 1228 |
| 1224 /** | 1229 /** |
| 1225 * @param {string} tabId | 1230 * @param {string} tabId |
| 1226 * @param {!UI.ContextMenu} contextMenu | 1231 * @param {!UI.ContextMenu} contextMenu |
| 1227 */ | 1232 */ |
| 1228 onContextMenu(tabId, contextMenu) {} | 1233 onContextMenu(tabId, contextMenu) {} |
| 1229 }; | 1234 }; |
| OLD | NEW |