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

Unified Diff: ui/webui/resources/js/cr/ui.js

Issue 12614002: Fixing ignored clicks after the 'Undo delete' command in Bookmark manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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: ui/webui/resources/js/cr/ui.js
diff --git a/ui/webui/resources/js/cr/ui.js b/ui/webui/resources/js/cr/ui.js
index e10e13573e1fd35071acb0c866e266d8fefab935..0b1aa368b00ac692619c4ab75fa1065161f0dc5b 100644
--- a/ui/webui/resources/js/cr/ui.js
+++ b/ui/webui/resources/js/cr/ui.js
@@ -176,7 +176,7 @@ cr.define('cr.ui', function() {
*/
function swallowDoubleClick(e) {
var doc = e.target.ownerDocument;
- var counter = e.type == 'click' ? e.detail : 0;
+ var counter = Math.min(1, e.detail);
function swallow(e) {
e.stopPropagation();
e.preventDefault();
@@ -192,8 +192,13 @@ cr.define('cr.ui', function() {
doc.removeEventListener('click', onclick, true);
}
}
- doc.addEventListener('click', onclick, true);
- doc.addEventListener('dblclick', swallow, true);
+ // The following 'click' event (if e.type == 'mouseup') mustn't be taken
+ // into account (it mustn't stop tracking clicks). Start event listening
+ // after zero timeout.
+ setTimeout(function() {
+ doc.addEventListener('click', onclick, true);
+ doc.addEventListener('dblclick', swallow, true);
+ }, 0);
}
return {
« 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