| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 UI.Tooltip = class { | 7 UI.Tooltip = class { |
| 8 /** | 8 /** |
| 9 * @param {!Document} doc | 9 * @param {!Document} doc |
| 10 */ | 10 */ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * @param {!Document} doc | 25 * @param {!Document} doc |
| 26 */ | 26 */ |
| 27 static installHandler(doc) { | 27 static installHandler(doc) { |
| 28 new UI.Tooltip(doc); | 28 new UI.Tooltip(doc); |
| 29 } | 29 } |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @param {!Element} element | 32 * @param {!Element} element |
| 33 * @param {!Element|string} tooltipContent | 33 * @param {?Element|string} tooltipContent |
| 34 * @param {string=} actionId | 34 * @param {string=} actionId |
| 35 * @param {!Object=} options | 35 * @param {!Object=} options |
| 36 */ | 36 */ |
| 37 static install(element, tooltipContent, actionId, options) { | 37 static install(element, tooltipContent, actionId, options) { |
| 38 if (typeof tooltipContent === 'string' && tooltipContent === '') { | 38 if (!tooltipContent) { |
| 39 delete element[UI.Tooltip._symbol]; | 39 delete element[UI.Tooltip._symbol]; |
| 40 return; | 40 return; |
| 41 } | 41 } |
| 42 element[UI.Tooltip._symbol] = {content: tooltipContent, actionId: actionId,
options: options || {}}; | 42 element[UI.Tooltip._symbol] = {content: tooltipContent, actionId: actionId,
options: options || {}}; |
| 43 } | 43 } |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * @param {!Element} element | 46 * @param {!Element} element |
| 47 */ | 47 */ |
| 48 static addNativeOverrideContainer(element) { | 48 static addNativeOverrideContainer(element) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 }, | 191 }, |
| 192 | 192 |
| 193 /** | 193 /** |
| 194 * @param {!Element|string} x | 194 * @param {!Element|string} x |
| 195 * @this {!Element} | 195 * @this {!Element} |
| 196 */ | 196 */ |
| 197 set: function(x) { | 197 set: function(x) { |
| 198 UI.Tooltip.install(this, x); | 198 UI.Tooltip.install(this, x); |
| 199 } | 199 } |
| 200 }); | 200 }); |
| OLD | NEW |