| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @unrestricted | 32 * @unrestricted |
| 33 */ | 33 */ |
| 34 UI.Popover = class extends UI.Widget { | 34 UI.Popover = class extends UI.Widget { |
| 35 /** | 35 /** |
| 36 * @param {!UI.PopoverHelper=} popoverHelper | 36 * @param {!UI.PopoverHelper=} popoverHelper |
| 37 */ | 37 */ |
| 38 constructor(popoverHelper) { | 38 constructor(popoverHelper) { |
| 39 super(true); | 39 super(false); |
| 40 this.markAsRoot(); | 40 this.markAsRoot(); |
| 41 this.element.classList.add('popover-element'); |
| 41 this.registerRequiredCSS('ui/popover.css'); | 42 this.registerRequiredCSS('ui/popover.css'); |
| 42 this._containerElement = createElementWithClass('div', 'fill popover-contain
er'); | 43 this._containerElement = createElementWithClass('div', 'fill popover-contain
er'); |
| 43 this._popupArrowElement = this.contentElement.createChild('div', 'arrow'); | 44 this._popupArrowElement = this.contentElement.createChild('div', 'arrow'); |
| 44 this._contentDiv = this.contentElement.createChild('div', 'popover-content')
; | 45 this._contentDiv = this.contentElement.createChild('div', 'popover-content')
; |
| 45 this._popoverHelper = popoverHelper; | 46 this._popoverHelper = popoverHelper; |
| 46 this._hideBound = this.hide.bind(this); | 47 this._hideBound = this.hide.bind(this); |
| 47 } | 48 } |
| 48 | 49 |
| 49 /** | 50 /** |
| 50 * @param {!Element} element | 51 * @param {!Element} element |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 if (this._hidePopoverTimer) { | 376 if (this._hidePopoverTimer) { |
| 376 clearTimeout(this._hidePopoverTimer); | 377 clearTimeout(this._hidePopoverTimer); |
| 377 delete this._hidePopoverTimer; | 378 delete this._hidePopoverTimer; |
| 378 | 379 |
| 379 // We know that we reached the popup, but we might have moved over other e
lements. | 380 // We know that we reached the popup, but we might have moved over other e
lements. |
| 380 // Discard pending command. | 381 // Discard pending command. |
| 381 this._resetHoverTimer(); | 382 this._resetHoverTimer(); |
| 382 } | 383 } |
| 383 } | 384 } |
| 384 }; | 385 }; |
| OLD | NEW |