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

Side by Side Diff: Source/devtools/front_end/ui/SoftContextMenu.js

Issue 1301603003: DevTools: do not discard soft context menu on glass pane mouseup unconditionally. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2011 Google Inc. All Rights Reserved. 2 * Copyright (C) 2011 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 break; 322 break;
323 } 323 }
324 event.consume(true); 324 event.consume(true);
325 }, 325 },
326 326
327 _glassPaneMouseUp: function(event) 327 _glassPaneMouseUp: function(event)
328 { 328 {
329 // Return if this is simple 'click', since dispatched on glass pane, can 't use 'click' event. 329 // Return if this is simple 'click', since dispatched on glass pane, can 't use 'click' event.
330 if (new Date().getTime() - this._time < 300) 330 if (new Date().getTime() - this._time < 300)
331 return; 331 return;
332 if (event.target === this.element)
333 return;
332 this._discardMenu(true, event); 334 this._discardMenu(true, event);
333 event.consume(); 335 event.consume();
334 }, 336 },
335 337
336 /** 338 /**
337 * @param {boolean} closeParentMenus 339 * @param {boolean} closeParentMenus
338 * @param {!Event=} event 340 * @param {!Event=} event
339 */ 341 */
340 _discardMenu: function(closeParentMenus, event) 342 _discardMenu: function(closeParentMenus, event)
341 { 343 {
(...skipping 28 matching lines...) Expand all
370 372
371 _discardSubMenus: function() 373 _discardSubMenus: function()
372 { 374 {
373 if (this._subMenu) 375 if (this._subMenu)
374 this._subMenu._discardSubMenus(); 376 this._subMenu._discardSubMenus();
375 this._contextMenuElement.remove(); 377 this._contextMenuElement.remove();
376 if (this._parentMenu) 378 if (this._parentMenu)
377 delete this._parentMenu._subMenu; 379 delete this._parentMenu._subMenu;
378 } 380 }
379 } 381 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698