Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions angular-ui-router-uib-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,28 @@ angular.module("ui.router.modal", ["ui.router"])
}
}

var thisModal = openModal = $uibModal.open(options);
var openModalFunc = function () {
var thisModal = openModal = $uibModal.open(options);

openModal.result['finally'](function() {
if (thisModal === openModal) {
// Dialog was closed via $uibModalInstance.close/dismiss, go to our parent state
$state.go($state.get("^", stateName).name);
}
});
openModal.result['finally'](function() {
if (thisModal === openModal) {
// Dialog was closed via $uibModalInstance.close/dismiss, go to our parent state
$state.go($state.get("^", stateName).name);
}
});

}


if (options.templateProvider) {
options.templateProvider().then(function (template) {
options.template = template;
openModalFunc();
})
}
else {
openModalFunc();
}
};

// Make sure that onEnter receives state.resolve configuration
Expand Down
28 changes: 21 additions & 7 deletions src/angular-ui-router-uib-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,28 @@ angular.module("ui.router.modal", ["ui.router"])
}
}

var thisModal = openModal = $uibModal.open(options);
var openModalFunc = function () {
var thisModal = openModal = $uibModal.open(options);

openModal.result['finally'](function() {
if (thisModal === openModal) {
// Dialog was closed via $uibModalInstance.close/dismiss, go to our parent state
$state.go($state.get("^", stateName).name);
}
});
openModal.result['finally'](function() {
if (thisModal === openModal) {
// Dialog was closed via $uibModalInstance.close/dismiss, go to our parent state
$state.go($state.get("^", stateName).name);
}
});

}


if (options.templateProvider) {
options.templateProvider().then(function (template) {
options.template = template;
openModalFunc();
})
}
else {
openModalFunc();
}
};

// Make sure that onEnter receives state.resolve configuration
Expand Down