hadron-document
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -351,2 +351,14 @@ 'use strict'; | ||
/** | ||
* Determine if the key of the parent element is editable. | ||
* | ||
* @returns {Boolean} If the parent's key is editable. | ||
*/ | ||
isParentEditable() { | ||
if (this.parent && !this.parent.isRoot()) { | ||
return this.parent.isKeyEditable(); | ||
} | ||
return true; | ||
} | ||
/** | ||
* Determine if the key is editable. | ||
@@ -357,3 +369,3 @@ * | ||
isKeyEditable() { | ||
return this.isAdded() || (this.currentKey !== ID); | ||
return this.isParentEditable() && (this.isAdded() || (this.currentKey !== ID)); | ||
} | ||
@@ -360,0 +372,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"homepage": "https://github.com/mongodb-js/hadron-document", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"repository": { | ||
@@ -10,0 +10,0 @@ "type": "git", |
34579
885