Skip to content

Commit ab9a9c9

Browse files
bound onBlur and onFocus methods to corresponding game events
1 parent dd824c4 commit ab9a9c9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

v3/src/sound/BaseSoundManager.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ var BaseSoundManager = new Class({
5757
* @property {boolean} pauseOnBlur
5858
*/
5959
this.pauseOnBlur = true;
60+
game.events.on('ON_BLUR', function () {
61+
if (this.pauseOnBlur) {
62+
this.onBlur();
63+
}
64+
}.bind(this));
65+
game.events.on('ON_FOCUS', function () {
66+
if (this.pauseOnBlur) {
67+
this.onFocus();
68+
}
69+
}.bind(this));
6070
/**
6171
* [description]
6272
*

0 commit comments

Comments
 (0)