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