OLD | NEW |
1 (function() { | 1 (function() { |
2 var Utility = { | 2 var Utility = { |
3 distance: function(x1, y1, x2, y2) { | 3 distance: function(x1, y1, x2, y2) { |
4 var xDelta = (x1 - x2); | 4 var xDelta = (x1 - x2); |
5 var yDelta = (y1 - y2); | 5 var yDelta = (y1 - y2); |
6 | 6 |
7 return Math.sqrt(xDelta * xDelta + yDelta * yDelta); | 7 return Math.sqrt(xDelta * xDelta + yDelta * yDelta); |
8 }, | 8 }, |
9 | 9 |
10 now: window.performance && window.performance.now ? | 10 now: window.performance && window.performance.now ? |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 535 |
536 this.ripples.splice(rippleIndex, 1); | 536 this.ripples.splice(rippleIndex, 1); |
537 | 537 |
538 ripple.remove(); | 538 ripple.remove(); |
539 | 539 |
540 if (!this.ripples.length) { | 540 if (!this.ripples.length) { |
541 this._setAnimating(false); | 541 this._setAnimating(false); |
542 } | 542 } |
543 }, | 543 }, |
544 | 544 |
| 545 /** |
| 546 * This conflicts with Element#antimate(). |
| 547 * https://developer.mozilla.org/en-US/docs/Web/API/Element/animate |
| 548 * @suppress {checkTypes} |
| 549 */ |
545 animate: function() { | 550 animate: function() { |
546 if (!this._animating) { | 551 if (!this._animating) { |
547 return; | 552 return; |
548 } | 553 } |
549 var index; | 554 var index; |
550 var ripple; | 555 var ripple; |
551 | 556 |
552 for (index = 0; index < this.ripples.length; ++index) { | 557 for (index = 0; index < this.ripples.length; ++index) { |
553 ripple = this.ripples[index]; | 558 ripple = this.ripples[index]; |
554 | 559 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 /** | 602 /** |
598 Fired when the animation finishes. | 603 Fired when the animation finishes. |
599 This is useful if you want to wait until | 604 This is useful if you want to wait until |
600 the ripple animation finishes to perform some action. | 605 the ripple animation finishes to perform some action. |
601 | 606 |
602 @event transitionend | 607 @event transitionend |
603 @param {{node: Object}} detail Contains the animated node. | 608 @param {{node: Object}} detail Contains the animated node. |
604 */ | 609 */ |
605 }); | 610 }); |
606 })(); | 611 })(); |
OLD | NEW |