* Wrapper for defined pause method. * Pause component by removing tick behavior and calling user's pause method. * * @param {function} pauseMethod * @returns {function}
(pauseMethod)
| 718 | * @returns {function} |
| 719 | */ |
| 720 | function wrapPause (pauseMethod) { |
| 721 | return function pause () { |
| 722 | var sceneEl = this.el.sceneEl; |
| 723 | if (!this.isPlaying) { return; } |
| 724 | pauseMethod.call(this); |
| 725 | this.isPlaying = false; |
| 726 | this.eventsDetach(); |
| 727 | // Remove tick behavior. |
| 728 | if (!hasBehavior(this)) { return; } |
| 729 | sceneEl.removeBehavior(this); |
| 730 | }; |
| 731 | } |
| 732 | |
| 733 | /** |
| 734 | * Wrapper for defined play method. |
no test coverage detected