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

Unified Diff: tracing/tracing/ui/base/mouse_tracker.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: rebase Created 3 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 | « tracing/tracing/ui/base/mouse_mode_selector.html ('k') | tracing/tracing/ui/base/name_bar_chart_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/base/mouse_tracker.html
diff --git a/tracing/tracing/ui/base/mouse_tracker.html b/tracing/tracing/ui/base/mouse_tracker.html
index 86c74afd9e7ea4f0ee9b0c974040cfe58509ca0d..ef4298eab4e14802924fd4273805e5f9586c9024 100644
--- a/tracing/tracing/ui/base/mouse_tracker.html
+++ b/tracing/tracing/ui/base/mouse_tracker.html
@@ -39,16 +39,17 @@ tr.exportTo('tr.ui.b', function() {
},
set targetElement(targetElement) {
- if (this.targetElement_)
+ if (this.targetElement_) {
this.targetElement_.removeEventListener('mousedown', this.onMouseDown_);
+ }
this.targetElement_ = targetElement;
- if (this.targetElement_)
+ if (this.targetElement_) {
this.targetElement_.addEventListener('mousedown', this.onMouseDown_);
+ }
},
onMouseDown_: function(e) {
- if (e.button !== 0)
- return true;
+ if (e.button !== 0) return true;
e = this.remakeEvent_(e, 'mouse-tracker-start');
this.targetElement_.dispatchEvent(e);
@@ -93,15 +94,18 @@ tr.exportTo('tr.ui.b', function() {
opt_mouseUpHandler, opt_keyUpHandler) {
function cleanupAndDispatchToMouseUp(e) {
document.removeEventListener('mousemove', mouseMoveHandler);
- if (opt_keyUpHandler)
+ if (opt_keyUpHandler) {
document.removeEventListener('keyup', opt_keyUpHandler);
+ }
document.removeEventListener('mouseup', cleanupAndDispatchToMouseUp);
- if (opt_mouseUpHandler)
+ if (opt_mouseUpHandler) {
opt_mouseUpHandler(e);
+ }
}
document.addEventListener('mousemove', mouseMoveHandler);
- if (opt_keyUpHandler)
+ if (opt_keyUpHandler) {
document.addEventListener('keyup', opt_keyUpHandler);
+ }
document.addEventListener('mouseup', cleanupAndDispatchToMouseUp);
}
« no previous file with comments | « tracing/tracing/ui/base/mouse_mode_selector.html ('k') | tracing/tracing/ui/base/name_bar_chart_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698