Skip to content

Commit ff57a8e

Browse files
committed
0.0.16
1 parent 9fbe280 commit ff57a8e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/pbox.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -319,24 +319,23 @@
319319
}, this._options.delay);
320320
};
321321

322-
BoxModal.prototype.close = function (result) {
322+
BoxModal.prototype._destroy = function (result) {
323323
this._remove();
324324
this.$watch && this.$watch();
325325
this._scope && this._scope.$destroy();
326326
this._scope = null;
327327
$document.unbind("mousedown.pbox" + this._id);
328328
$document.unbind("keydown.pbox" + this._id);
329-
_resultDeferred.resolve(result);
329+
};
330+
331+
BoxModal.prototype.close = function (result) {
332+
this._destroy();
333+
this.resultDeferred.resolve(result);
330334
};
331335

332336
BoxModal.prototype.dismiss = function (reason) {
333-
this._remove();
334-
this.$watch && this.$watch();
335-
this._scope && this._scope.$destroy();
336-
this._scope = null;
337-
$document.unbind("mousedown.pbox" + this._id);
338-
$document.unbind("keydown.pbox" + this._id);
339-
_resultDeferred.reject(reason);
337+
this._destroy();
338+
this.resultDeferred.reject(reason);
340339
}
341340
}
342341

0 commit comments

Comments
 (0)