diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 83f6fdd..b6dbb3c 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -2482,13 +2482,11 @@ this.capture(e); }); - this.button.on('pointerout', e => { - this.capture(e); - TweenLite.to([this.button, this.content], this.theme.fast, { - alpha: 1, - overwrite: 'none' - }); - }); + this.button.on('pointerout', this.onEnd.bind(this)); + this.button.on('pointercancel', this.onEnd.bind(this)); + this.button.on('pointerupoutside', this.onEnd.bind(this)); + this.button.on('pointertap', this.onEnd.bind(this)); + this.button.on('scroll', this.onEnd.bind(this)); // eslint-disable-next-line no-unused-vars this.button.on('pointerdown', e => { @@ -2921,6 +2919,14 @@ this.icon.tint = value; } } + + onEnd(event) { + this.capture(event); + TweenLite.to([this.button, this.content], this.theme.fast, { + alpha: 1, + overwrite: 'none' + }); + } } /* globals ThrowPropsPlugin, Strong */ diff --git a/lib/pixi/button.js b/lib/pixi/button.js index f56a851..e414988 100644 --- a/lib/pixi/button.js +++ b/lib/pixi/button.js @@ -252,13 +252,11 @@ export default class Button extends PIXI.Container { this.capture(e) }) - this.button.on('pointerout', e => { - this.capture(e) - TweenLite.to([this.button, this.content], this.theme.fast, { - alpha: 1, - overwrite: 'none' - }) - }) + this.button.on('pointerout', this.onEnd.bind(this)) + this.button.on('pointercancel', this.onEnd.bind(this)) + this.button.on('pointerupoutside', this.onEnd.bind(this)) + this.button.on('pointertap', this.onEnd.bind(this)) + this.button.on('scroll', this.onEnd.bind(this)) // eslint-disable-next-line no-unused-vars this.button.on('pointerdown', e => { @@ -691,4 +689,12 @@ export default class Button extends PIXI.Container { this.icon.tint = value } } + + onEnd(event) { + this.capture(event) + TweenLite.to([this.button, this.content], this.theme.fast, { + alpha: 1, + overwrite: 'none' + }) + } }