From 60408a103ade6f0622b0b9f1d07afbc659fb9fa2 Mon Sep 17 00:00:00 2001 From: Andreas Rotter Date: Fri, 6 Feb 2015 14:13:36 +0100 Subject: [PATCH] phantom browser doesn't have the hide property, so the bind on this doesnt work --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); + }); }; /**