From db5fde4749cfc60adc8de0020f8791a73c8e63a1 Mon Sep 17 00:00:00 2001 From: alekseybobkov Date: Sat, 17 Oct 2015 18:00:20 -0700 Subject: [PATCH] Minor fixes in Inspector --- .../system/assets/ui/js/inspector.editor.dictionary.js | 4 ++++ .../system/assets/ui/js/inspector.editor.objectlist.js | 10 +++++++++- modules/system/assets/ui/js/inspector.editor.set.js | 6 +++++- modules/system/assets/ui/storm-min.js | 8 ++++++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/modules/system/assets/ui/js/inspector.editor.dictionary.js b/modules/system/assets/ui/js/inspector.editor.dictionary.js index 1a7e8833c..0981434b7 100644 --- a/modules/system/assets/ui/js/inspector.editor.dictionary.js +++ b/modules/system/assets/ui/js/inspector.editor.dictionary.js @@ -31,6 +31,10 @@ BaseProto.init.call(this) } + DictionaryEditor.prototype.supportsExternalParameterEditor = function() { + return false + } + // // Popup editor methods // diff --git a/modules/system/assets/ui/js/inspector.editor.objectlist.js b/modules/system/assets/ui/js/inspector.editor.objectlist.js index d14661a61..10b7f7557 100644 --- a/modules/system/assets/ui/js/inspector.editor.objectlist.js +++ b/modules/system/assets/ui/js/inspector.editor.objectlist.js @@ -47,6 +47,10 @@ BaseProto.dispose.call(this) } + ObjectListEditor.prototype.supportsExternalParameterEditor = function() { + return false + } + // // Building // @@ -64,9 +68,13 @@ } ObjectListEditor.prototype.setLinkText = function(link, value) { - var value = value !== undefined ? value + var value = value !== undefined && value !== null ? value : this.inspector.getPropertyValue(this.propertyDefinition.property) + if (value === null) { + value = undefined + } + if (value === undefined) { var placeholder = this.propertyDefinition.placeholder diff --git a/modules/system/assets/ui/js/inspector.editor.set.js b/modules/system/assets/ui/js/inspector.editor.set.js index 77e347317..a28d0e304 100644 --- a/modules/system/assets/ui/js/inspector.editor.set.js +++ b/modules/system/assets/ui/js/inspector.editor.set.js @@ -72,7 +72,7 @@ } SetEditor.prototype.setLinkText = function(link, value) { - var value = value !== undefined ? value + var value = (value !== undefined && value !== null) ? value : this.getNormalizedValue(), text = '[ ]' @@ -241,6 +241,10 @@ SetEditor.prototype.getNormalizedValue = function() { var value = this.inspector.getPropertyValue(this.propertyDefinition.property) + if (value === null) { + value = undefined + } + if (value === undefined) { return value } diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index 5039adbdf..81d523ff1 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -4314,7 +4314,7 @@ else{this.loadDynamicItems()}} SetEditor.prototype.loadStaticItems=function(){var itemArray=[] for(var itemValue in this.propertyDefinition.items){itemArray.push({value:itemValue,title:this.propertyDefinition.items[itemValue]})} for(var i=itemArray.length-1;i>=0;i--){this.buildItemEditor(itemArray[i].value,itemArray[i].title)}} -SetEditor.prototype.setLinkText=function(link,value){var value=value!==undefined?value:this.getNormalizedValue(),text='[ ]' +SetEditor.prototype.setLinkText=function(link,value){var value=(value!==undefined&&value!==null)?value:this.getNormalizedValue(),text='[ ]' if(value===undefined){value=this.propertyDefinition.default} if(value!==undefined&&value.length!==undefined&&value.length>0&&typeof value!=='string'){var textValues=[] for(var i=0,len=value.length;i