| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * | 10 * |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 * @template T | 1145 * @template T |
| 1146 */ | 1146 */ |
| 1147 UI.registerCustomElement = function(localName, typeExtension, prototype) { | 1147 UI.registerCustomElement = function(localName, typeExtension, prototype) { |
| 1148 return document.registerElement(typeExtension, {prototype: Object.create(proto
type), extends: localName}); | 1148 return document.registerElement(typeExtension, {prototype: Object.create(proto
type), extends: localName}); |
| 1149 }; | 1149 }; |
| 1150 | 1150 |
| 1151 /** | 1151 /** |
| 1152 * @param {string} text | 1152 * @param {string} text |
| 1153 * @param {function(!Event)=} clickHandler | 1153 * @param {function(!Event)=} clickHandler |
| 1154 * @param {string=} className | 1154 * @param {string=} className |
| 1155 * @param {string=} title | |
| 1156 * @return {!Element} | 1155 * @return {!Element} |
| 1157 */ | 1156 */ |
| 1158 UI.createTextButton = function(text, clickHandler, className, title) { | 1157 UI.createTextButton = function(text, clickHandler, className) { |
| 1159 var element = createElementWithClass('button', className || '', 'text-button')
; | 1158 var element = createElementWithClass('button', className || '', 'text-button')
; |
| 1160 element.textContent = text; | 1159 element.textContent = text; |
| 1161 if (clickHandler) | 1160 if (clickHandler) |
| 1162 element.addEventListener('click', clickHandler, false); | 1161 element.addEventListener('click', clickHandler, false); |
| 1163 if (title) | |
| 1164 element.title = title; | |
| 1165 return element; | 1162 return element; |
| 1166 }; | 1163 }; |
| 1167 | 1164 |
| 1168 /** | 1165 /** |
| 1169 * @param {string} name | 1166 * @param {string} name |
| 1170 * @param {string} title | 1167 * @param {string} title |
| 1171 * @param {boolean=} checked | 1168 * @param {boolean=} checked |
| 1172 * @return {!Element} | 1169 * @return {!Element} |
| 1173 */ | 1170 */ |
| 1174 UI.createRadioLabel = function(name, title, checked) { | 1171 UI.createRadioLabel = function(name, title, checked) { |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2021 */ | 2018 */ |
| 2022 UI.createInlineButton = function(toolbarButton) { | 2019 UI.createInlineButton = function(toolbarButton) { |
| 2023 var element = createElement('span'); | 2020 var element = createElement('span'); |
| 2024 var shadowRoot = UI.createShadowRootWithCoreStyles(element, 'ui/inlineButton.c
ss'); | 2021 var shadowRoot = UI.createShadowRootWithCoreStyles(element, 'ui/inlineButton.c
ss'); |
| 2025 element.classList.add('inline-button'); | 2022 element.classList.add('inline-button'); |
| 2026 var toolbar = new UI.Toolbar(''); | 2023 var toolbar = new UI.Toolbar(''); |
| 2027 toolbar.appendToolbarItem(toolbarButton); | 2024 toolbar.appendToolbarItem(toolbarButton); |
| 2028 shadowRoot.appendChild(toolbar.element); | 2025 shadowRoot.appendChild(toolbar.element); |
| 2029 return element; | 2026 return element; |
| 2030 }; | 2027 }; |
| OLD | NEW |