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 29 matching lines...) Expand all Loading... |
40 this._disableOnClick = !!disableOnClick; | 40 this._disableOnClick = !!disableOnClick; |
41 this._hasPadding = false; | 41 this._hasPadding = false; |
42 panelElement.addEventListener('mousedown', this._mouseDown.bind(this), false
); | 42 panelElement.addEventListener('mousedown', this._mouseDown.bind(this), false
); |
43 panelElement.addEventListener('mousemove', this._mouseMove.bind(this), false
); | 43 panelElement.addEventListener('mousemove', this._mouseMove.bind(this), false
); |
44 panelElement.addEventListener('mouseout', this._mouseOut.bind(this), false); | 44 panelElement.addEventListener('mouseout', this._mouseOut.bind(this), false); |
45 this.setTimeout(1000, 500); | 45 this.setTimeout(1000, 500); |
46 } | 46 } |
47 | 47 |
48 /** | 48 /** |
49 * @param {function(!Element, !Event):(!Element|!AnchorBox|undefined)} getAnch
or | 49 * @param {function(!Element, !Event):(!Element|!AnchorBox|undefined)} getAnch
or |
50 * @param {function(!Element, !UI.GlassPane):!Promise<boolean>} showPopover | 50 * @param {function((!Element|!AnchorBox), !UI.GlassPane):!Promise<boolean>} s
howPopover |
51 * @param {function()=} onHide | 51 * @param {function()=} onHide |
52 */ | 52 */ |
53 initializeCallbacks(getAnchor, showPopover, onHide) { | 53 initializeCallbacks(getAnchor, showPopover, onHide) { |
54 this._getAnchor = getAnchor; | 54 this._getAnchor = getAnchor; |
55 this._showPopover = showPopover; | 55 this._showPopover = showPopover; |
56 this._onHide = onHide; | 56 this._onHide = onHide; |
57 } | 57 } |
58 | 58 |
59 /** | 59 /** |
60 * @param {number} timeout | 60 * @param {number} timeout |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 if (this._hidePopoverTimer) { | 213 if (this._hidePopoverTimer) { |
214 clearTimeout(this._hidePopoverTimer); | 214 clearTimeout(this._hidePopoverTimer); |
215 delete this._hidePopoverTimer; | 215 delete this._hidePopoverTimer; |
216 | 216 |
217 // We know that we reached the popup, but we might have moved over other e
lements. | 217 // We know that we reached the popup, but we might have moved over other e
lements. |
218 // Discard pending command. | 218 // Discard pending command. |
219 this._resetHoverTimer(); | 219 this._resetHoverTimer(); |
220 } | 220 } |
221 } | 221 } |
222 }; | 222 }; |
OLD | NEW |