| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 * @param {string} actionId | 187 * @param {string} actionId |
| 188 * @return {!UI.ToolbarToggle} | 188 * @return {!UI.ToolbarToggle} |
| 189 */ | 189 */ |
| 190 static createActionButtonForId(actionId) { | 190 static createActionButtonForId(actionId) { |
| 191 const action = UI.actionRegistry.action(actionId); | 191 const action = UI.actionRegistry.action(actionId); |
| 192 return UI.Toolbar.createActionButton(/** @type {!UI.Action} */ (action)); | 192 return UI.Toolbar.createActionButton(/** @type {!UI.Action} */ (action)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 /** | 195 /** |
| 196 * @param {boolean=} reverse | 196 * @param {boolean=} reverse |
| 197 * @param {boolean=} growVertically |
| 197 */ | 198 */ |
| 198 makeWrappable(reverse) { | 199 makeWrappable(reverse, growVertically) { |
| 199 this._contentElement.classList.add('wrappable'); | 200 this._contentElement.classList.add('wrappable'); |
| 200 this._reverse = !!reverse; | 201 this._reverse = !!reverse; |
| 201 if (reverse) | 202 if (reverse) |
| 202 this._contentElement.classList.add('wrappable-reverse'); | 203 this._contentElement.classList.add('wrappable-reverse'); |
| 204 if (growVertically) |
| 205 this._contentElement.classList.add('toolbar-grow-vertical'); |
| 203 } | 206 } |
| 204 | 207 |
| 205 makeVertical() { | 208 makeVertical() { |
| 206 this._contentElement.classList.add('vertical'); | 209 this._contentElement.classList.add('vertical'); |
| 207 } | 210 } |
| 208 | 211 |
| 209 makeBlueOnHover() { | 212 makeBlueOnHover() { |
| 210 this._contentElement.classList.add('toolbar-blue-on-hover'); | 213 this._contentElement.classList.add('toolbar-blue-on-hover'); |
| 211 } | 214 } |
| 212 | 215 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 * @param {boolean} x | 425 * @param {boolean} x |
| 423 */ | 426 */ |
| 424 setVisible(x) { | 427 setVisible(x) { |
| 425 if (this._visible === x) | 428 if (this._visible === x) |
| 426 return; | 429 return; |
| 427 this.element.classList.toggle('hidden', !x); | 430 this.element.classList.toggle('hidden', !x); |
| 428 this._visible = x; | 431 this._visible = x; |
| 429 if (this._toolbar && !(this instanceof UI.ToolbarSeparator)) | 432 if (this._toolbar && !(this instanceof UI.ToolbarSeparator)) |
| 430 this._toolbar._hideSeparatorDupes(); | 433 this._toolbar._hideSeparatorDupes(); |
| 431 } | 434 } |
| 435 |
| 436 setRightAligned(alignRight) { |
| 437 this.element.classList.toggle('toolbar-item-right-aligned', alignRight); |
| 438 } |
| 432 }; | 439 }; |
| 433 | 440 |
| 434 /** | 441 /** |
| 435 * @unrestricted | 442 * @unrestricted |
| 436 */ | 443 */ |
| 437 UI.ToolbarText = class extends UI.ToolbarItem { | 444 UI.ToolbarText = class extends UI.ToolbarItem { |
| 438 /** | 445 /** |
| 439 * @param {string=} text | 446 * @param {string=} text |
| 440 */ | 447 */ |
| 441 constructor(text) { | 448 constructor(text) { |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 /** | 1054 /** |
| 1048 * @param {!Common.Setting} setting | 1055 * @param {!Common.Setting} setting |
| 1049 * @param {string=} tooltip | 1056 * @param {string=} tooltip |
| 1050 * @param {string=} alternateTitle | 1057 * @param {string=} alternateTitle |
| 1051 */ | 1058 */ |
| 1052 constructor(setting, tooltip, alternateTitle) { | 1059 constructor(setting, tooltip, alternateTitle) { |
| 1053 super(alternateTitle || setting.title() || '', tooltip); | 1060 super(alternateTitle || setting.title() || '', tooltip); |
| 1054 UI.SettingsUI.bindCheckbox(this.inputElement, setting); | 1061 UI.SettingsUI.bindCheckbox(this.inputElement, setting); |
| 1055 } | 1062 } |
| 1056 }; | 1063 }; |
| OLD | NEW |