| 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 /** | 1010 /** |
| 1011 * @unrestricted | 1011 * @unrestricted |
| 1012 */ | 1012 */ |
| 1013 UI.ToolbarCheckbox = class extends UI.ToolbarItem { | 1013 UI.ToolbarCheckbox = class extends UI.ToolbarItem { |
| 1014 /** | 1014 /** |
| 1015 * @param {string} text | 1015 * @param {string} text |
| 1016 * @param {string=} tooltip | 1016 * @param {string=} tooltip |
| 1017 * @param {function()=} listener | 1017 * @param {function()=} listener |
| 1018 */ | 1018 */ |
| 1019 constructor(text, tooltip, listener) { | 1019 constructor(text, tooltip, listener) { |
| 1020 super(UI.createCheckboxLabel(text)); | 1020 super(UI.CheckboxLabel.create(text)); |
| 1021 this.element.classList.add('checkbox'); | 1021 this.element.classList.add('checkbox'); |
| 1022 this.inputElement = this.element.checkboxElement; | 1022 this.inputElement = this.element.checkboxElement; |
| 1023 if (tooltip) | 1023 if (tooltip) |
| 1024 this.element.title = tooltip; | 1024 this.element.title = tooltip; |
| 1025 if (listener) | 1025 if (listener) |
| 1026 this.inputElement.addEventListener('click', listener, false); | 1026 this.inputElement.addEventListener('click', listener, false); |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 /** | 1029 /** |
| 1030 * @return {boolean} | 1030 * @return {boolean} |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1054 /** | 1054 /** |
| 1055 * @param {!Common.Setting} setting | 1055 * @param {!Common.Setting} setting |
| 1056 * @param {string=} tooltip | 1056 * @param {string=} tooltip |
| 1057 * @param {string=} alternateTitle | 1057 * @param {string=} alternateTitle |
| 1058 */ | 1058 */ |
| 1059 constructor(setting, tooltip, alternateTitle) { | 1059 constructor(setting, tooltip, alternateTitle) { |
| 1060 super(alternateTitle || setting.title() || '', tooltip); | 1060 super(alternateTitle || setting.title() || '', tooltip); |
| 1061 UI.SettingsUI.bindCheckbox(this.inputElement, setting); | 1061 UI.SettingsUI.bindCheckbox(this.inputElement, setting); |
| 1062 } | 1062 } |
| 1063 }; | 1063 }; |
| OLD | NEW |