We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
onNodeName
1 parent 535a47c commit 1e29d2aCopy full SHA for 1e29d2a
src/js/Node.js
@@ -4472,11 +4472,14 @@ Node.prototype.updateNodeName = function () {
4472
var count = this.childs ? this.childs.length : 0;
4473
var nodeName;
4474
if (this.type === 'object' || this.type === 'array') {
4475
- nodeName = this.editor.options.onNodeName({
4476
- path: this.getPath(),
4477
- size: count,
4478
- type: this.type
4479
- });
+ if (this.editor.options.onNodeName) {
+ nodeName = this.editor.options.onNodeName({
+ path: this.getPath(),
+ size: count,
+ type: this.type
4480
+ });
4481
+ }
4482
+
4483
this.dom.value.innerHTML = (this.type === 'object')
4484
? '{' + (nodeName || count) + '}'
4485
: '[' + (nodeName || count) + ']';
0 commit comments