ui: use parent/grandparent keys for key creation
This commit is contained in:
parent
91b7adc678
commit
993e4319be
|
@ -70,14 +70,15 @@ App.KvShowController.reopen({
|
||||||
this.set('isLoading', true);
|
this.set('isLoading', true);
|
||||||
|
|
||||||
var newKey = this.get('newKey');
|
var newKey = this.get('newKey');
|
||||||
var topModel = this.get('topModel');
|
var parentKey = this.get('parentKey');
|
||||||
|
var grandParentKey = this.get('grandParentKey');
|
||||||
var controller = this;
|
var controller = this;
|
||||||
|
|
||||||
// If we don't have a previous model to base
|
// If we don't have a previous model to base
|
||||||
// on our parent, or we're not at the root level,
|
// on our parent, or we're not at the root level,
|
||||||
// strip the leading slash.
|
// strip the leading slash.
|
||||||
if (!topModel || topModel.get('parentKey') != "/") {
|
if (!parentKey || parentKey != "/") {
|
||||||
newKey.set('Key', (topModel.get('parentKey') + newKey.get('Key')));
|
newKey.set('Key', (parentKey + newKey.get('Key')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put the Key and the Value retrieved from the form
|
// Put the Key and the Value retrieved from the form
|
||||||
|
|
Loading…
Reference in New Issue