| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * ImageEditor is the top level object that holds together and connects | 8 * ImageEditor is the top level object that holds together and connects |
| 9 * everything needed for image editing. | 9 * everything needed for image editing. |
| 10 * | 10 * |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 this.dragHappened_ = false; | 740 this.dragHappened_ = false; |
| 741 e.preventDefault(); | 741 e.preventDefault(); |
| 742 } | 742 } |
| 743 }; | 743 }; |
| 744 | 744 |
| 745 /** | 745 /** |
| 746 * Touch end handler. | 746 * Touch end handler. |
| 747 * @param {TouchEvent} e Event. | 747 * @param {TouchEvent} e Event. |
| 748 */ | 748 */ |
| 749 ImageEditor.MouseControl.prototype.onTouchEnd = function(e) { | 749 ImageEditor.MouseControl.prototype.onTouchEnd = function(e) { |
| 750 if (!this.dragHappened_ && Date.now() - this.touchStartInfo_.time <= | 750 if (!this.dragHappened_ && |
| 751 ImageEditor.MouseControl.MAX_TAP_DURATION_) { | 751 this.touchStartInfo_ && |
| 752 Date.now() - this.touchStartInfo_.time <= |
| 753 ImageEditor.MouseControl.MAX_TAP_DURATION_) { |
| 752 this.buffer_.onClick(this.touchStartInfo_.x, this.touchStartInfo_.y); | 754 this.buffer_.onClick(this.touchStartInfo_.x, this.touchStartInfo_.y); |
| 753 if (this.previousTouchStartInfo_ && | 755 if (this.previousTouchStartInfo_ && |
| 754 Date.now() - this.previousTouchStartInfo_.time < | 756 Date.now() - this.previousTouchStartInfo_.time < |
| 755 ImageEditor.MouseControl.MAX_DOUBLE_TAP_DURATION_) { | 757 ImageEditor.MouseControl.MAX_DOUBLE_TAP_DURATION_) { |
| 756 var prevTouchCircle = new Circle( | 758 var prevTouchCircle = new Circle( |
| 757 this.previousTouchStartInfo_.x, | 759 this.previousTouchStartInfo_.x, |
| 758 this.previousTouchStartInfo_.y, | 760 this.previousTouchStartInfo_.y, |
| 759 ImageEditor.MouseControl.MAX_DISTANCE_FOR_DOUBLE_TAP_); | 761 ImageEditor.MouseControl.MAX_DISTANCE_FOR_DOUBLE_TAP_); |
| 760 if (prevTouchCircle.inside(this.touchStartInfo_.x, | 762 if (prevTouchCircle.inside(this.touchStartInfo_.x, |
| 761 this.touchStartInfo_.y)) { | 763 this.touchStartInfo_.y)) { |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 | 1196 |
| 1195 /** | 1197 /** |
| 1196 * Hide the prompt. | 1198 * Hide the prompt. |
| 1197 */ | 1199 */ |
| 1198 ImageEditor.Prompt.prototype.hide = function() { | 1200 ImageEditor.Prompt.prototype.hide = function() { |
| 1199 if (!this.prompt_) return; | 1201 if (!this.prompt_) return; |
| 1200 this.prompt_.setAttribute('state', 'fadeout'); | 1202 this.prompt_.setAttribute('state', 'fadeout'); |
| 1201 // Allow some time for the animation to play out. | 1203 // Allow some time for the animation to play out. |
| 1202 this.setTimer(this.reset.bind(this), 500); | 1204 this.setTimer(this.reset.bind(this), 500); |
| 1203 }; | 1205 }; |
| OLD | NEW |