Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.

Commit

Permalink
Building 0.0.4-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Jun 26, 2014
1 parent dc97be5 commit ea39a5c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui-router-extras",
"version": "0.0.2-preview",
"version": "0.0.4-preview",
"authors": [
"Chris Thielen <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "",
"name": "ui-router-extras",
"version": "0.0.2-preview",
"version": "0.0.4-preview",
"description": "",
"homepage": "",
"dependencies": {},
Expand Down
23 changes: 14 additions & 9 deletions release/ct-ui-router-extras.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angular.module("ct.ui.router.extras", [ 'ui.router' ]);
var lastDot = stateName.lastIndexOf(".");
if (lastDot != -1) {
var parentStatus = recordDeepStateRedirectStatus(stateName.substr(0, lastDot));
if (parentStatus) {
if (parentStatus && deepStateRedirectsByName[stateName] === undefined) {
deepStateRedirectsByName[stateName] = ANCESTOR_REDIRECT;
}
}
Expand Down Expand Up @@ -327,8 +327,8 @@ angular.module("ct.ui.router.extras").provider("$stickyState", $StickyStateProvi
var _StickyState; // internal reference to $stickyStateProvider
var internalStates = {}; // Map { statename -> InternalStateObj } holds internal representation of all states
var root, // Root state, internal representation
pendingTransitions = [], // One transition may supercede another. This holds references to all pending transitions
pendingRestore, // The restore function from the superceded transition
pendingTransitions = [], // One transition may supersede another. This holds references to all pending transitions
pendingRestore, // The restore function from the superseded transition
inactivePseudoState; // This pseudo state holds all the inactive states' locals (resolved state data, such as views etc)

// Creates a blank surrogate state
Expand Down Expand Up @@ -619,7 +619,7 @@ angular.module("ct.ui.router.extras").config(
}, function transitionFailed(err) {
if (err.message !== "transition prevented"
&& err.message !== "transition aborted"
&& err.message !== "transition superceded") {
&& err.message !== "transition superseded") {
$log.debug("transition failed", err);
console.log(err.stack);
}
Expand Down Expand Up @@ -677,8 +677,12 @@ angular.module("ct.ui.router.extras").config(
futureUrlPrefixes[futureState.urlPrefix] = futureState;
};

this.get = function() {
return angular.extend({}, futureStates);
};

/* options is an object with at least a name or url attribute */
function findFutureState(options) {
function findFutureState($state, options) {
if (options.name) {
var nameComponents = options.name.split(/\./);
while (nameComponents.length) {
Expand Down Expand Up @@ -737,7 +741,7 @@ angular.module("ct.ui.router.extras").config(
}


var futureState = findFutureState({ url: $location.path() });
var futureState = findFutureState($state, { url: $location.path() });
if (!futureState) {
return $injector.invoke(otherwiseFunc);
}
Expand Down Expand Up @@ -777,7 +781,7 @@ angular.module("ct.ui.router.extras").config(
if (transitionPending) return;
$log.debug("event, unfoundState, fromState, fromParams", event, unfoundState, fromState, fromParams);

var futureState = findFutureState({ name: unfoundState.to });
var futureState = findFutureState($state, { name: unfoundState.to });
if (futureState == null) return;

event.preventDefault();
Expand Down Expand Up @@ -818,9 +822,10 @@ angular.module("ct.ui.router.extras").config(
});
}
init();

serviceObject.futureState = provider.futureState;

serviceObject.state = $stateProvider.state;
serviceObject.futureState = provider.futureState;
serviceObject.get = provider.get;

return serviceObject;
}
Expand Down
Loading

0 comments on commit ea39a5c

Please sign in to comment.