Skip to content

Commit 4ae4374

Browse files
committed
0.0.6
1 parent 9b658b5 commit 4ae4374

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/pbox.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247

248248
BoxModal.prototype._bindEvents = function () {
249249
var _self = this;
250+
_self._pboxElement.bind("click.pbox",function(e){
251+
e.stopPropagation();
252+
});
250253
$document.bind("click.pbox" + this._id, function (e) {
251254
var _eTarget = angular.element(e.target);
252255
if (util.hasClass(_eTarget, 'pbox')) {
@@ -278,8 +281,8 @@
278281
$body.append(this._pboxElement);
279282
$timeout(function () {
280283
$wtPosition.calculatePos(_self._options, $target, _self._pboxElement);
284+
_self._bindEvents();
281285
});
282-
this._bindEvents();
283286
};
284287

285288
BoxModal.prototype.close = function (result) {
@@ -328,8 +331,12 @@
328331
templateAndResolvePromise.then(function resolveSuccess(tplAndVars) {
329332

330333
var boxScope = (options.scope || $rootScope).$new();
331-
boxScope.$close = pboxInstance.close;
332-
boxScope.$dismiss = pboxInstance.dismiss;
334+
boxScope.$close = function(result){
335+
pboxInstance.close(result);
336+
};
337+
boxScope.$dismiss = function(){
338+
pboxInstance.dismiss();
339+
};
333340

334341
var ctrlInstance, ctrlLocals = {};
335342
var resolveIter = 1;

0 commit comments

Comments
 (0)