| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 var dropdownArrowIcon = UI.Icon.create('smallicon-dropdown-arrow', 'toolbar-
dropdown-arrow'); | 504 var dropdownArrowIcon = UI.Icon.create('smallicon-dropdown-arrow', 'toolbar-
dropdown-arrow'); |
| 505 this.element.appendChild(dropdownArrowIcon); | 505 this.element.appendChild(dropdownArrowIcon); |
| 506 if (width) | 506 if (width) |
| 507 this.element.style.width = width + 'px'; | 507 this.element.style.width = width + 'px'; |
| 508 } | 508 } |
| 509 | 509 |
| 510 /** | 510 /** |
| 511 * @param {!Event} event | 511 * @param {!Event} event |
| 512 */ | 512 */ |
| 513 _clicked(event) { | 513 _clicked(event) { |
| 514 var defaultPrevented = this.dispatchEventToListeners('click', event); | 514 this.dispatchEventToListeners(UI.ToolbarButton.Events.Click, event); |
| 515 event.consume(defaultPrevented); | |
| 516 } | 515 } |
| 517 | 516 |
| 518 /** | 517 /** |
| 519 * @param {!Event} event | 518 * @param {!Event} event |
| 520 */ | 519 */ |
| 521 _mouseDown(event) { | 520 _mouseDown(event) { |
| 522 this.dispatchEventToListeners('mousedown', event); | 521 this.dispatchEventToListeners(UI.ToolbarButton.Events.MouseDown, event); |
| 523 } | 522 } |
| 524 | 523 |
| 525 /** | 524 /** |
| 526 * @param {!Event} event | 525 * @param {!Event} event |
| 527 */ | 526 */ |
| 528 _mouseUp(event) { | 527 _mouseUp(event) { |
| 529 this.dispatchEventToListeners('mouseup', event); | 528 this.dispatchEventToListeners(UI.ToolbarButton.Events.MouseUp, event); |
| 530 } | 529 } |
| 531 }; | 530 }; |
| 532 | 531 |
| 532 UI.ToolbarButton.Events = { |
| 533 Click: Symbol('Click'), |
| 534 MouseDown: Symbol('MouseDown'), |
| 535 MouseUp: Symbol('MouseUp') |
| 536 }; |
| 537 |
| 533 /** | 538 /** |
| 534 * @unrestricted | 539 * @unrestricted |
| 535 */ | 540 */ |
| 536 UI.ToolbarInput = class extends UI.ToolbarItem { | 541 UI.ToolbarInput = class extends UI.ToolbarItem { |
| 537 /** | 542 /** |
| 538 * @param {string=} placeholder | 543 * @param {string=} placeholder |
| 539 * @param {number=} growFactor | 544 * @param {number=} growFactor |
| 540 */ | 545 */ |
| 541 constructor(placeholder, growFactor) { | 546 constructor(placeholder, growFactor) { |
| 542 super(createElementWithClass('input', 'toolbar-item')); | 547 super(createElementWithClass('input', 'toolbar-item')); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 562 value() { | 567 value() { |
| 563 return this.element.value; | 568 return this.element.value; |
| 564 } | 569 } |
| 565 | 570 |
| 566 _onChangeCallback() { | 571 _onChangeCallback() { |
| 567 this.dispatchEventToListeners(UI.ToolbarInput.Event.TextChanged, this.elemen
t.value); | 572 this.dispatchEventToListeners(UI.ToolbarInput.Event.TextChanged, this.elemen
t.value); |
| 568 } | 573 } |
| 569 }; | 574 }; |
| 570 | 575 |
| 571 UI.ToolbarInput.Event = { | 576 UI.ToolbarInput.Event = { |
| 572 TextChanged: 'TextChanged' | 577 TextChanged: Symbol('TextChanged') |
| 573 }; | 578 }; |
| 574 | 579 |
| 575 /** | 580 /** |
| 576 * @unrestricted | 581 * @unrestricted |
| 577 */ | 582 */ |
| 578 UI.ToolbarToggle = class extends UI.ToolbarButton { | 583 UI.ToolbarToggle = class extends UI.ToolbarButton { |
| 579 /** | 584 /** |
| 580 * @param {string} title | 585 * @param {string} title |
| 581 * @param {string=} glyph | 586 * @param {string=} glyph |
| 582 * @param {string=} toggledGlyph | 587 * @param {string=} toggledGlyph |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 return this.inputElement.checked; | 901 return this.inputElement.checked; |
| 897 } | 902 } |
| 898 | 903 |
| 899 /** | 904 /** |
| 900 * @param {boolean} value | 905 * @param {boolean} value |
| 901 */ | 906 */ |
| 902 setChecked(value) { | 907 setChecked(value) { |
| 903 this.inputElement.checked = value; | 908 this.inputElement.checked = value; |
| 904 } | 909 } |
| 905 }; | 910 }; |
| OLD | NEW |