Skip to content

Commit

Permalink
Bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
nonplus committed Aug 26, 2016
1 parent 7036434 commit b53548f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions angular-ui-router-uib-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
*
* @link https://github.com/nonplus/angular-ui-router-uib-modal
*
* @license angular-ui-router-uib-modal v0.0.8
* @license angular-ui-router-uib-modal v0.0.9
* (c) Copyright Stepan Riha <[email protected]>
* License MIT
*/

(function(angular) {

/* global angular */
"use strict";
angular.module("ui.router.modal", ["ui.router"])
.config(["$stateProvider", function($stateProvider) {

var stateProviderState = $stateProvider.state;

$stateProvider.state = function (stateName, options) {
$stateProvider.state = function(stateName, options) {

if (options.modal) {

Expand All @@ -28,7 +29,7 @@ angular.module("ui.router.modal", ["ui.router"])
throw new Error("Invalid modal state definition: The onExit setting may not be specified.");
}

var modalInstance;
var openModal;

// Get modal.resolve keys from state.modal or state.resolve
var resolve = (Array.isArray(options.modal) ? options.modal : []).concat(Object.keys(options.resolve || {}));
Expand All @@ -44,10 +45,10 @@ angular.module("ui.router.modal", ["ui.router"])
}
}

modalInstance = $uibModal.open(options);
var thisModal = openModal = $uibModal.open(options);

modalInstance.result['finally'](function() {
if (modalInstance) {
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);
}
Expand All @@ -58,10 +59,10 @@ angular.module("ui.router.modal", ["ui.router"])
options.onEnter.$inject = inject.concat(resolve);

options.onExit = function() {
if (modalInstance) {
if (openModal) {
// State has changed while dialog was open
modalInstance.close();
modalInstance = null;
openModal.close();
openModal = null;
}
};

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-ui-router-uib-modal",
"version": "0.0.8",
"version": "0.0.9",
"homepage": "https://github.com/nonplus/angular-ui-router-uib-modal",
"authors": [
"Stepan Riha <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-ui-router-uib-modal",
"version": "0.0.8",
"version": "0.0.9",
"description": "AngularJS module that adds support for ui-bootstrap modal states when using ui-router.",
"main": "angular-ui-router-uib-modal.js",
"directories": {
Expand Down

0 comments on commit b53548f

Please sign in to comment.