Ox.URL: add support for /documents/ID/span

This commit is contained in:
rolux 2015-02-05 11:44:10 +05:30
parent 36ffd07203
commit 62ade0f54f

View file

@ -791,7 +791,16 @@ Ox.URL = function(options) {
parts.shift();
if (parts.length) {
// may modify state.part
self.options.getPart(state, decodeValue(parts[0]), getHash);
self.options.getPart(state, decodeValue(parts[0]), function() {
if (state.part) {
parts.shift();
if (parts.length) {
parsePartSpan();
} else {
getHash();
}
}
});
} else {
getHash();
}
@ -966,6 +975,9 @@ Ox.URL = function(options) {
}
getHash();
}
function parsePartSpan() {
options.getSpan(state, decodeValue(parts.join('/')), getHash);
}
function getHash() {
self.options.getHash(state, function() {
// may have modified state.hash