diff --git a/index.js b/index.js index 45ef727..0922497 100644 --- a/index.js +++ b/index.js @@ -73,8 +73,11 @@ function Dialog(options) { this.render(options); if (active && !active.hiding) active.hide(); if (exports.effect) this.effect(exports.effect); - this.on('escape', this.hide.bind(this)); + active = this; + this.on('escape', function(){ + active.hide(); + }); }; /**