atomic-routes
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -23,17 +23,17 @@ (typeof module !== "undefined" && module !== null ? function(moduleBody) { | ||
NavigationState.prototype._update = function(subPath) { | ||
var changeListener, j, len, ref, results; | ||
var changeListener, _i, _len, _ref, _results; | ||
if (this._isDestroyed) { | ||
throw new Error('already destroyed'); | ||
} | ||
ref = this._listenerList; | ||
results = []; | ||
for (j = 0, len = ref.length; j < len; j++) { | ||
changeListener = ref[j]; | ||
results.push(changeListener(subPath)); | ||
_ref = this._listenerList; | ||
_results = []; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
changeListener = _ref[_i]; | ||
_results.push(changeListener(subPath)); | ||
} | ||
return results; | ||
return _results; | ||
}; | ||
NavigationState.prototype._destroy = function() { | ||
var changeListener, j, len, ref, results; | ||
var changeListener, _i, _len, _ref, _results; | ||
if (this._isDestroyed) { | ||
@@ -44,9 +44,9 @@ throw new Error('already destroyed'); | ||
this._resolveWhenDestroyed(); | ||
ref = this._listenerList; | ||
results = []; | ||
for (j = 0, len = ref.length; j < len; j++) { | ||
changeListener = ref[j]; | ||
results.push(changeListener(null)); | ||
_ref = this._listenerList; | ||
_results = []; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
changeListener = _ref[_i]; | ||
_results.push(changeListener(null)); | ||
} | ||
return results; | ||
return _results; | ||
}; | ||
@@ -66,3 +66,3 @@ | ||
matchPath = function(subPath) { | ||
var args, i, j, len, segment; | ||
var args, i, segment, _i, _len; | ||
if (subPath.length < suffixPath.length) { | ||
@@ -72,3 +72,3 @@ return null; | ||
args = []; | ||
for (i = j = 0, len = suffixPath.length; j < len; i = ++j) { | ||
for (i = _i = 0, _len = suffixPath.length; _i < _len; i = ++_i) { | ||
segment = suffixPath[i]; | ||
@@ -84,4 +84,4 @@ if (segment[0] === ':') { | ||
matchCurrentArgs = function(args) { | ||
var i, j, len, x; | ||
for (i = j = 0, len = args.length; j < len; i = ++j) { | ||
var i, x, _i, _len; | ||
for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { | ||
x = args[i]; | ||
@@ -107,3 +107,3 @@ if (x !== currentArgs[i]) { | ||
if (currentState === null) { | ||
currentState = new NavigationState(_this, suffix, match[1]); | ||
currentState = new NavigationState(_this, subPath.slice(0, suffixPath.length), match[1]); | ||
currentArgs = match[0]; | ||
@@ -123,2 +123,3 @@ return cb.apply(null, currentArgs.concat([currentState])); | ||
NavigationState.prototype.enter = function(subPath) { | ||
var fullPrefix; | ||
if (this._isDestroyed) { | ||
@@ -130,3 +131,4 @@ throw new Error('already destroyed'); | ||
} | ||
window.location = '#' + this._fullPath + subPath; | ||
fullPrefix = this._fullPath.length > 0 ? '#/' + this._fullPath.join('/') : '#'; | ||
window.location = fullPrefix + subPath; | ||
}; | ||
@@ -152,4 +154,4 @@ | ||
}); | ||
return root = new NavigationState(null, '', getHashPath()); | ||
return root = new NavigationState(null, [], getHashPath()); | ||
}; | ||
}); |
@@ -0,0 +0,0 @@ var gulp = require('gulp'); |
@@ -0,0 +0,0 @@ module.exports = function(config) { |
{ | ||
"name": "atomic-routes", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"main": "dist/atomic-routes.js", | ||
@@ -5,0 +5,0 @@ "description": "Decentralized nested client-side routing with Promises. Framework-agnostic, composable, simple: designed to work with component-based application UIs.", |
@@ -0,0 +0,0 @@ # Atomic Routes |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16676
6
186