Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Popover.js

Issue 2825593002: DevTools: Make timeline screenshots overlay disapper quickly on mouseout (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/perf_ui/TimelineOverviewPane.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 28 matching lines...) Expand all
39 constructor(container, getRequest) { 39 constructor(container, getRequest) {
40 this._disableOnClick = false; 40 this._disableOnClick = false;
41 this._hasPadding = false; 41 this._hasPadding = false;
42 this._getRequest = getRequest; 42 this._getRequest = getRequest;
43 this._scheduledRequest = null; 43 this._scheduledRequest = null;
44 /** @type {?function()} */ 44 /** @type {?function()} */
45 this._hidePopoverCallback = null; 45 this._hidePopoverCallback = null;
46 container.addEventListener('mousedown', this._mouseDown.bind(this), false); 46 container.addEventListener('mousedown', this._mouseDown.bind(this), false);
47 container.addEventListener('mousemove', this._mouseMove.bind(this), false); 47 container.addEventListener('mousemove', this._mouseMove.bind(this), false);
48 container.addEventListener('mouseout', this._mouseOut.bind(this), false); 48 container.addEventListener('mouseout', this._mouseOut.bind(this), false);
49 this.setTimeout(1000, 500); 49 this.setTimeout(1000);
50 } 50 }
51 51
52 /** 52 /**
53 * @param {number} timeout 53 * @param {number} showTimeout
54 * @param {number=} hideTimeout 54 * @param {number=} hideTimeout
55 */ 55 */
56 setTimeout(timeout, hideTimeout) { 56 setTimeout(showTimeout, hideTimeout) {
57 this._timeout = timeout; 57 this._showTimeout = showTimeout;
58 if (typeof hideTimeout === 'number') 58 this._hideTimeout = typeof hideTimeout === 'number' ? hideTimeout : showTime out / 2;
59 this._hideTimeout = hideTimeout;
60 else
61 this._hideTimeout = timeout / 2;
62 } 59 }
63 60
64 /** 61 /**
65 * @param {boolean} hasPadding 62 * @param {boolean} hasPadding
66 */ 63 */
67 setHasPadding(hasPadding) { 64 setHasPadding(hasPadding) {
68 this._hasPadding = hasPadding; 65 this._hasPadding = hasPadding;
69 } 66 }
70 67
71 /** 68 /**
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 */ 101 */
105 _mouseMove(event) { 102 _mouseMove(event) {
106 // Pretend that nothing has happened. 103 // Pretend that nothing has happened.
107 if (this._eventInScheduledContent(event)) 104 if (this._eventInScheduledContent(event))
108 return; 105 return;
109 106
110 this._startHidePopoverTimer(this._hideTimeout); 107 this._startHidePopoverTimer(this._hideTimeout);
111 this._stopShowPopoverTimer(); 108 this._stopShowPopoverTimer();
112 if (event.which && this._disableOnClick) 109 if (event.which && this._disableOnClick)
113 return; 110 return;
114 this._startShowPopoverTimer(event, this.isPopoverVisible() ? this._timeout * 0.6 : this._timeout); 111 this._startShowPopoverTimer(event, this.isPopoverVisible() ? this._showTimeo ut * 0.6 : this._showTimeout);
115 } 112 }
116 113
117 /** 114 /**
118 * @param {!Event} event 115 * @param {!Event} event
119 */ 116 */
120 _popoverMouseMove(event) { 117 _popoverMouseMove(event) {
121 this._stopHidePopoverTimer(); 118 this._stopHidePopoverTimer();
122 } 119 }
123 120
124 /** 121 /**
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 this._hidePopoverCallback = () => { 232 this._hidePopoverCallback = () => {
236 if (request.hide) 233 if (request.hide)
237 request.hide.call(null); 234 request.hide.call(null);
238 popover.hide(); 235 popover.hide();
239 delete UI.PopoverHelper._popoverHelper; 236 delete UI.PopoverHelper._popoverHelper;
240 }; 237 };
241 }); 238 });
242 } 239 }
243 240
244 _stopHidePopoverTimer() { 241 _stopHidePopoverTimer() {
245 if (!this._hidePopoverTimer) 242 if (!this._hidePopoverTimer || !this._hideTimeout)
dgozman 2017/04/17 23:16:13 Why this change? It affects ElementsPanel and Anim
246 return; 243 return;
247 clearTimeout(this._hidePopoverTimer); 244 clearTimeout(this._hidePopoverTimer);
248 delete this._hidePopoverTimer; 245 delete this._hidePopoverTimer;
249 246
250 // We know that we reached the popup, but we might have moved over other ele ments. 247 // We know that we reached the popup, but we might have moved over other ele ments.
251 // Discard pending command. 248 // Discard pending command.
252 this._stopShowPopoverTimer(); 249 this._stopShowPopoverTimer();
253 } 250 }
254 }; 251 };
255 252
256 /** @typedef {{box: !AnchorBox, show:(function(!UI.GlassPane):!Promise<boolean>) , hide:(function()|undefined)}} */ 253 /** @typedef {{box: !AnchorBox, show:(function(!UI.GlassPane):!Promise<boolean>) , hide:(function()|undefined)}} */
257 UI.PopoverRequest; 254 UI.PopoverRequest;
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/perf_ui/TimelineOverviewPane.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698