diff --git a/modules/system/assets/ui/js/inspector.editor.base.js b/modules/system/assets/ui/js/inspector.editor.base.js
index 5bdf6dfbe..c0f0cd9f0 100644
--- a/modules/system/assets/ui/js/inspector.editor.base.js
+++ b/modules/system/assets/ui/js/inspector.editor.base.js
@@ -118,7 +118,7 @@
BaseEditor.prototype.isEmptyValue = function(value) {
return value === undefined
|| value === null
- || $.isEmptyObject(value)
+ || (typeof value == 'object' && $.isEmptyObject(value) )
|| (typeof value == 'string' && $.trim(value).length === 0)
|| (Object.prototype.toString.call(value) === '[object Array]' && value.length === 0)
}
diff --git a/modules/system/assets/ui/js/inspector.editor.checkbox.js b/modules/system/assets/ui/js/inspector.editor.checkbox.js
index b842e7045..fa924c551 100644
--- a/modules/system/assets/ui/js/inspector.editor.checkbox.js
+++ b/modules/system/assets/ui/js/inspector.editor.checkbox.js
@@ -78,6 +78,14 @@
this.getInput().checked = this.normalizeCheckedValue(value)
}
+ CheckboxEditor.prototype.isEmptyValue = function(value) {
+ if (value === 0 || value === '0' || value === 'false') {
+ return true
+ }
+
+ return BaseProto.isEmptyValue.call(this, value)
+ }
+
CheckboxEditor.prototype.registerHandlers = function() {
var input = this.getInput()
diff --git a/modules/system/assets/ui/js/inspector.editor.dropdown.js b/modules/system/assets/ui/js/inspector.editor.dropdown.js
index 02fd3eec7..776ec0408 100644
--- a/modules/system/assets/ui/js/inspector.editor.dropdown.js
+++ b/modules/system/assets/ui/js/inspector.editor.dropdown.js
@@ -135,6 +135,24 @@
return false
}
+ DropdownEditor.prototype.normalizeValue = function(value) {
+ if (!this.propertyDefinition.booleanValues) {
+ return value
+ }
+
+ var str = String(value)
+
+ if (str.length === 0) {
+ return ''
+ }
+
+ if (str === 'true') {
+ return true
+ }
+
+ return false
+ }
+
//
// Event handlers
//
@@ -148,7 +166,7 @@
DropdownEditor.prototype.onSelectionChange = function() {
var select = this.getSelect()
- this.inspector.setPropertyValue(this.propertyDefinition.property, select.value, this.initialization)
+ this.inspector.setPropertyValue(this.propertyDefinition.property, this.normalizeValue(select.value), this.initialization)
}
DropdownEditor.prototype.onInspectorPropertyChanged = function(property, value) {
@@ -191,12 +209,24 @@
var select = this.getSelect()
if (select) {
- return select.value
+ return this.normalizeValue(select.value)
}
return undefined
}
+ DropdownEditor.prototype.isEmptyValue = function(value) {
+ if (this.propertyDefinition.booleanValues) {
+ if (value === '') {
+ return true
+ }
+
+ return false
+ }
+
+ return BaseProto.isEmptyValue.call(this, value)
+ }
+
//
// Disposing
//
diff --git a/modules/system/assets/ui/js/inspector.editor.stringlist.js b/modules/system/assets/ui/js/inspector.editor.stringlist.js
index 2779e750c..2dd009201 100644
--- a/modules/system/assets/ui/js/inspector.editor.stringlist.js
+++ b/modules/system/assets/ui/js/inspector.editor.stringlist.js
@@ -65,6 +65,8 @@
}
$textarea.focus()
+
+ this.configureComment(popup)
}
StringListEditor.prototype.handleSubmit = function($form) {
diff --git a/modules/system/assets/ui/js/inspector.editor.text.js b/modules/system/assets/ui/js/inspector.editor.text.js
index 28dc74026..9a6a6d6b8 100644
--- a/modules/system/assets/ui/js/inspector.editor.text.js
+++ b/modules/system/assets/ui/js/inspector.editor.text.js
@@ -46,6 +46,7 @@
\
\
@@ -56,6 +57,15 @@
'
}
+ TextEditor.prototype.configureComment = function(popup) {
+ if (!this.propertyDefinition.description) {
+ return
+ }
+
+ var descriptionElement = $(popup).find('p.inspector-field-comment')
+ descriptionElement.text(this.propertyDefinition.description)
+ }
+
TextEditor.prototype.configurePopup = function(popup) {
var $textarea = $(popup).find('textarea'),
value = this.inspector.getPropertyValue(this.propertyDefinition.property)
@@ -70,6 +80,8 @@
$textarea.val(value)
$textarea.focus()
+
+ this.configureComment(popup)
}
TextEditor.prototype.handleSubmit = function($form) {
diff --git a/modules/system/assets/ui/js/inspector.engine.js b/modules/system/assets/ui/js/inspector.engine.js
index b8abbb11a..b5ff5df4f 100644
--- a/modules/system/assets/ui/js/inspector.engine.js
+++ b/modules/system/assets/ui/js/inspector.engine.js
@@ -40,6 +40,17 @@
},
groupIndex = 0
+ for (var i = 0, len = properties.length; i < len; i++) {
+ var property = properties[i]
+
+ if (property['sortOrder'] === undefined) {
+ property['sortOrder'] = (i+1)*20
+ }
+ }
+
+ properties.sort(function(a, b){
+ return a['sortOrder'] - b['sortOrder']
+ })
for (var i = 0, len = properties.length; i < len; i++) {
var property = properties[i]
diff --git a/modules/system/assets/ui/js/inspector.surface.js b/modules/system/assets/ui/js/inspector.surface.js
index 25cd1cf6e..a7710881b 100644
--- a/modules/system/assets/ui/js/inspector.surface.js
+++ b/modules/system/assets/ui/js/inspector.surface.js
@@ -796,9 +796,9 @@
if (!externalParameterEditor || !externalParameterEditor.isEditorVisible()) {
value = this.getPropertyValue(property.property)
- if (value === undefined) {
- var editor = this.findPropertyEditor(property.property)
+ var editor = this.findPropertyEditor(property.property)
+ if (value === undefined) {
if (editor) {
value = editor.getUndefinedValue()
}
diff --git a/modules/system/assets/ui/less/inspector.less b/modules/system/assets/ui/less/inspector.less
index 6e6c14a92..24644b0a6 100644
--- a/modules/system/assets/ui/less/inspector.less
+++ b/modules/system/assets/ui/less/inspector.less
@@ -602,6 +602,12 @@ div.inspector-dictionary-container {
}
}
+.inspector-field-comment {
+ &:empty {
+ display: none;
+ }
+}
+
.select2-dropdown {
&.ocInspectorDropdown {
font-size: 12px;
diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js
index b60367cbe..dc5601a8a 100644
--- a/modules/system/assets/ui/storm-min.js
+++ b/modules/system/assets/ui/storm-min.js
@@ -3568,8 +3568,8 @@ for(var i=0,len=this.parsedProperties.properties.length;i
\
\
@@ -4360,11 +4374,15 @@ TextEditor.prototype.getPopupContent=function(){return''}
+TextEditor.prototype.configureComment=function(popup){if(!this.propertyDefinition.description){return}
+var descriptionElement=$(popup).find('p.inspector-field-comment')
+descriptionElement.text(this.propertyDefinition.description)}
TextEditor.prototype.configurePopup=function(popup){var $textarea=$(popup).find('textarea'),value=this.inspector.getPropertyValue(this.propertyDefinition.property)
if(this.propertyDefinition.placeholder){$textarea.attr('placeholder',this.propertyDefinition.placeholder)}
if(value===undefined){value=this.propertyDefinition.default}
$textarea.val(value)
-$textarea.focus()}
+$textarea.focus()
+this.configureComment(popup)}
TextEditor.prototype.handleSubmit=function($form){var $textarea=$form.find('textarea'),link=this.getLink(),value=$.trim($textarea.val())
this.inspector.setPropertyValue(this.propertyDefinition.property,value)}
$.oc.inspector.propertyEditors.text=TextEditor}(window.jQuery);+function($){"use strict";var Base=$.oc.inspector.propertyEditors.base,BaseProto=Base.prototype
@@ -4765,7 +4783,8 @@ if(this.propertyDefinition.placeholder){$textarea.attr('placeholder',this.proper
if(value===undefined){value=this.propertyDefinition.default}
this.checkValueType(value)
if(value&&value.length){$textarea.val(value.join('\n'))}
-$textarea.focus()}
+$textarea.focus()
+this.configureComment(popup)}
StringListEditor.prototype.handleSubmit=function($form){var $textarea=$form.find('textarea'),link=this.getLink(),value=$.trim($textarea.val()),arrayValue=[],resultValue=[]
if(value.length){value=value.replace(/\r\n/g,'\n')
arrayValue=value.split('\n')
diff --git a/modules/system/assets/ui/storm.css b/modules/system/assets/ui/storm.css
index 9dc00468c..5906bb67c 100644
--- a/modules/system/assets/ui/storm.css
+++ b/modules/system/assets/ui/storm.css
@@ -2529,6 +2529,7 @@ div.inspector-dictionary-container table.inspector-dictionary-table tbody tr:las
.inspector-header .detach{right:26px}
.inspector-header .close{right:11px;font-size:21px}
.inspector-container .control-scrollpad{position:absolute}
+.inspector-field-comment:empty{display:none}
.select2-dropdown.ocInspectorDropdown{font-size:12px;-webkit-border-radius:0 !important;-moz-border-radius:0 !important;border-radius:0 !important;border:none !important}
.select2-dropdown.ocInspectorDropdown > .select2-results > .select2-results__options{font-size:12px}
.select2-dropdown.ocInspectorDropdown > .select2-results > li > div{padding:5px 12px 5px}