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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 9874018: [filebrowser] Prevent mouse events on the eject button except the designated handler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
===================================================================
--- chrome/browser/resources/file_manager/js/file_manager.js (revision 129402)
+++ chrome/browser/resources/file_manager/js/file_manager.js (working copy)
@@ -1873,8 +1873,13 @@
var eject = this.document_.createElement('div');
eject.className = 'root-eject';
- eject.addEventListener('click',
- this.unmountVolume_.bind(this, entry.toURL()));
+ eject.addEventListener('click', function(event) {
+ event.stopPropagation();
+ this.unmountVolume_(entry.toURL());
+ }.bind(this));
+ // Block other mouse handlers.
+ eject.addEventListener('mouseup', function(e) { e.stopPropagation() });
+ eject.addEventListener('mousedown', function(e) { e.stopPropagation() });
li.appendChild(eject);
cr.ui.contextMenuHandler.setContextMenu(li, this.rootsContextMenu_);
« 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