ui: fix edit view breadcrumbs

This commit is contained in:
Jack Pearkes 2014-04-30 21:29:45 -04:00
parent 8d36cf39dd
commit 32d0374a5a
2 changed files with 5 additions and 1 deletions

View File

@ -95,13 +95,14 @@ App.KvShowController.reopen({
data: newKey.get('Value')
}).then(function(response) {
controller.set('isLoading', false)
// transition to the right place
console.log(newKey.get('Key'));
if (newKey.get('isFolder') == true) {
controller.transitionToRoute('kv.show', newKey.get('urlSafeKey'));
} else {
controller.transitionToRoute('kv.edit', newKey.get('urlSafeKey'));
}
// Reload the keys in the left column
controller.get('keys').reload()
}).fail(function(response) {

View File

@ -174,6 +174,9 @@ App.KvEditRoute = App.BaseRoute.extend({
}
});
controller.set('parentKey', parentKey);
controller.set('grandParentKey', grandParentKey);
// If we don't have the cached model from our
// the kv.show controller, we need to go get it,
// otherwise we just load what we have.