overlay dispose fixes

This commit is contained in:
Adam Bradley
2015-06-23 09:49:39 -05:00
parent 909f667d4b
commit d030d9e136
2 changed files with 38 additions and 43 deletions

View File

@@ -20,6 +20,7 @@ export class Overlay {
app.appendComponent(ComponentType).then(ref => {
let overlay = ref.instance;
overlay._dispose = ref.dispose;
overlay.setApp(app);
overlay._type = overlayType;
overlay._handle = opts && opts.handle;
@@ -70,7 +71,7 @@ export class Overlay {
ClickBlock(true, leavingAnimation.duration() + 200);
leavingAnimation.play().then(() => {
this._dispose();
this.dispose();
ClickBlock(false);
leavingAnimation.dispose();
resolve();
@@ -105,8 +106,8 @@ export class Overlay {
util.extend(this.options, opts);
}
_dispose() {
this.dispose && this.dispose();
dispose() {
this._dispose && this._dispose();
if (this.app) {
util.array.remove(this.app.overlays, this);
}