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

Side by Side Diff: ui/webui/resources/js/cr/ui/touch_handler.js

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: update c/b/r/ as well Created 3 years, 12 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 | « ui/webui/resources/js/cr/ui/tabs.js ('k') | ui/webui/resources/js/cr/ui/tree.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Touch Handler. Class that handles all touch events and 6 * @fileoverview Touch Handler. Class that handles all touch events and
7 * uses them to interpret higher level gestures and behaviors. TouchEvent is a 7 * uses them to interpret higher level gestures and behaviors. TouchEvent is a
8 * built in mobile safari type: 8 * built in mobile safari type:
9 * http://developer.apple.com/safari/library/documentation/UserExperience/Refere nce/TouchEventClassReference/TouchEvent/TouchEvent.html. 9 * http://developer.apple.com/safari/library/documentation/UserExperience/Refere nce/TouchEventClassReference/TouchEvent/TouchEvent.html.
10 * This class is intended to work with all webkit browsers, tested on Chrome and 10 * This class is intended to work with all webkit browsers, tested on Chrome and
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 e.targetTouches[0] = touch; 407 e.targetTouches[0] = touch;
408 } 408 }
409 callback(e); 409 callback(e);
410 }; 410 };
411 }, 411 },
412 412
413 /** 413 /**
414 * Begin tracking the touchable element, it is eligible for dragging. 414 * Begin tracking the touchable element, it is eligible for dragging.
415 * @private 415 * @private
416 */ 416 */
417 beginTracking_: function() { this.tracking_ = true; }, 417 beginTracking_: function() {
418 this.tracking_ = true;
419 },
418 420
419 /** 421 /**
420 * Stop tracking the touchable element, it is no longer dragging. 422 * Stop tracking the touchable element, it is no longer dragging.
421 * @private 423 * @private
422 */ 424 */
423 endTracking_: function() { 425 endTracking_: function() {
424 this.tracking_ = false; 426 this.tracking_ = false;
425 this.dragging_ = false; 427 this.dragging_ = false;
426 this.totalMoveY_ = 0; 428 this.totalMoveY_ = 0;
427 this.totalMoveX_ = 0; 429 this.totalMoveX_ = 0;
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 event.dragDeltaY = clientY - this.startTouchY_; 871 event.dragDeltaY = clientY - this.startTouchY_;
870 } 872 }
871 873
872 this.element_.dispatchEvent(event); 874 this.element_.dispatchEvent(event);
873 return event.enableDrag; 875 return event.enableDrag;
874 } 876 }
875 }; 877 };
876 878
877 return {TouchHandler: TouchHandler}; 879 return {TouchHandler: TouchHandler};
878 }); 880 });
OLDNEW
« no previous file with comments | « ui/webui/resources/js/cr/ui/tabs.js ('k') | ui/webui/resources/js/cr/ui/tree.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698