|
2611 | 2611 |
|
2612 | 2612 | this.onPauseToggle = onPauseToggle.bind(this); |
2613 | 2613 |
|
2614 | | - this.pauseButton.forEach(function(element) |
2615 | | - { |
2616 | | - element.addEventListener('click', this.onPauseToggle); |
2617 | | - }.bind(this)); |
| 2614 | + for(var i = 0; i < this.pauseButton.length; i++){ |
| 2615 | + this.pauseButton[i].addEventListener('click', this.onPauseToggle); |
| 2616 | + } |
2618 | 2617 |
|
2619 | 2618 | /** |
2620 | 2619 | * If the application is currently paused manually |
|
2674 | 2673 | this.trigger('pause', paused); |
2675 | 2674 |
|
2676 | 2675 | // Set the pause button state |
2677 | | - this.pauseButton.forEach( |
2678 | | - function(element) |
2679 | | - { |
2680 | | - element.classList.remove('unpaused'); |
2681 | | - element.classList.remove('paused'); |
2682 | | - |
2683 | | - element.classList.add(paused ? 'paused' : 'unpaused'); |
2684 | | - }.bind(this) |
2685 | | - ); |
| 2676 | + for(var i = 0; i < this.pauseButton.length; i++){ |
| 2677 | + var element = this.pauseButton[i]; |
| 2678 | + element.classList.remove('unpaused'); |
| 2679 | + element.classList.remove('paused'); |
| 2680 | + element.classList.add(paused ? 'paused' : 'unpaused'); |
| 2681 | + } |
2686 | 2682 | } |
2687 | 2683 | }, |
2688 | 2684 | get: function() |
|
2713 | 2709 |
|
2714 | 2710 | plugin.opened = function() |
2715 | 2711 | { |
2716 | | - this.pauseButton.forEach( |
2717 | | - function(element) |
2718 | | - { |
2719 | | - element.classList.remove('disabled'); |
2720 | | - }.bind(this) |
2721 | | - ); |
| 2712 | + for(var i = 0; i < this.pauseButton.length; i++){ |
| 2713 | + this.pauseButton[i].classList.remove('disabled'); |
| 2714 | + } |
2722 | 2715 |
|
2723 | 2716 | // Reset the paused state |
2724 | 2717 | this.paused = this._paused; |
2725 | 2718 | }; |
2726 | 2719 |
|
2727 | 2720 | plugin.close = function() |
2728 | 2721 | { |
2729 | | - this.pauseButton.forEach(this._disableButton.bind(this)); |
| 2722 | + for(var i = 0; i < this.pauseButton.length; i++){ |
| 2723 | + this._disableButton.bind(this.pauseButton[i]); |
| 2724 | + } |
2730 | 2725 | this.paused = false; |
2731 | 2726 | }; |
2732 | 2727 |
|
2733 | 2728 | plugin.teardown = function() |
2734 | 2729 | { |
2735 | | - this.pauseButton.forEach( |
2736 | | - function(element) |
2737 | | - { |
2738 | | - element.removeEventListener('click', this.onPauseToggle); |
2739 | | - }.bind(this) |
2740 | | - ); |
| 2730 | + for(var i = 0; i < this.pauseButton.length; i++){ |
| 2731 | + this.pauseButton[i].removeEventListener('click', this.onPauseToggle); |
| 2732 | + } |
2741 | 2733 | delete this.pauseButton; |
2742 | 2734 | delete this._isManualPause; |
2743 | 2735 | delete this._paused; |
|
0 commit comments