From 70147ec8dd9bf9afdf4853f644bf556d921b7704 Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Wed, 30 Apr 2014 17:38:56 -0400 Subject: [PATCH] ui: use parent/grandparent keys for key creation --- ui/javascripts/app/controllers.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/javascripts/app/controllers.js b/ui/javascripts/app/controllers.js index 1e507fd20f..51c134efb4 100644 --- a/ui/javascripts/app/controllers.js +++ b/ui/javascripts/app/controllers.js @@ -70,14 +70,15 @@ App.KvShowController.reopen({ this.set('isLoading', true); var newKey = this.get('newKey'); - var topModel = this.get('topModel'); + var parentKey = this.get('parentKey'); + var grandParentKey = this.get('grandParentKey'); var controller = this; // If we don't have a previous model to base // on our parent, or we're not at the root level, // strip the leading slash. - if (!topModel || topModel.get('parentKey') != "/") { - newKey.set('Key', (topModel.get('parentKey') + newKey.get('Key'))); + if (!parentKey || parentKey != "/") { + newKey.set('Key', (parentKey + newKey.get('Key'))); } // Put the Key and the Value retrieved from the form