diff --git a/modules/system/assets/ui/js/inspector.editor.autocomplete.js b/modules/system/assets/ui/js/inspector.editor.autocomplete.js index 6e6215c09..64c835f3e 100644 --- a/modules/system/assets/ui/js/inspector.editor.autocomplete.js +++ b/modules/system/assets/ui/js/inspector.editor.autocomplete.js @@ -142,7 +142,7 @@ return result } - AutocompleteEditor.prototype.onInspectorPropertyChanged = function(property, value) { + AutocompleteEditor.prototype.onInspectorPropertyChanged = function(property) { if (!this.propertyDefinition.depends || this.propertyDefinition.depends.indexOf(property) === -1) { return } @@ -219,7 +219,7 @@ var itemsEvent = $.Event('autocompleteitems.oc.inspector') $inspectable.trigger(itemsEvent, [{ - values: values, + values: values, callback: this.proxy(this.itemsRequestDone), property: this.inspector.getPropertyPath(this.propertyDefinition.property), propertyDefinition: this.propertyDefinition @@ -253,4 +253,4 @@ } $.oc.inspector.propertyEditors.autocomplete = AutocompleteEditor -}(window.jQuery); \ No newline at end of file +}(window.jQuery); diff --git a/modules/system/assets/ui/js/inspector.editor.dropdown.js b/modules/system/assets/ui/js/inspector.editor.dropdown.js index 124c402e5..b5d2e25fe 100644 --- a/modules/system/assets/ui/js/inspector.editor.dropdown.js +++ b/modules/system/assets/ui/js/inspector.editor.dropdown.js @@ -112,6 +112,9 @@ dropdownCssClass: 'ocInspectorDropdown' } + if (this.propertyDefinition.emptyOption !== undefined) { + options.placeholder = this.propertyDefinition.emptyOption + } if (this.propertyDefinition.placeholder !== undefined) { options.placeholder = this.propertyDefinition.placeholder } @@ -131,7 +134,7 @@ } DropdownEditor.prototype.createPlaceholder = function(select) { - var placeholder = this.propertyDefinition.placeholder + var placeholder = this.propertyDefinition.placeholder || this.propertyDefinition.emptyOption if (placeholder !== undefined && !Modernizr.touchevents) { this.createOption(select, null, null) @@ -202,7 +205,7 @@ this.inspector.setPropertyValue(this.propertyDefinition.property, this.normalizeValue(select.value), this.initialization) } - DropdownEditor.prototype.onInspectorPropertyChanged = function(property, value) { + DropdownEditor.prototype.onInspectorPropertyChanged = function(property) { if (!this.propertyDefinition.depends || this.propertyDefinition.depends.indexOf(property) === -1) { return } @@ -260,7 +263,7 @@ return false } - return BaseProto.isEmptyValue.call(this, value) + return BaseProto.isEmptyValue.call(this, value) } // @@ -307,7 +310,8 @@ var currentValue = this.inspector.getPropertyValue(this.propertyDefinition.property), data = this.getRootSurface().getValues(), self = this, - $form = $(this.getSelect()).closest('form') + $form = $(this.getSelect()).closest('form'), + dependents = this.inspector.findDependentProperties(this.propertyDefinition.property) if (currentValue === undefined) { currentValue = this.propertyDefinition.default @@ -316,6 +320,15 @@ var callback = function dropdownOptionsRequestDoneClosure(data) { self.hideLoadingIndicator() self.optionsRequestDone(data, currentValue, true) + + if (dependents.length > 0) { + for (var i in dependents) { + var editor = self.inspector.findPropertyEditor(dependents[i]) + if (editor && typeof editor.onInspectorPropertyChanged === 'function') { + editor.onInspectorPropertyChanged(self.propertyDefinition.property) + } + } + } } if (this.propertyDefinition.depends) { @@ -347,7 +360,7 @@ var optionsEvent = $.Event('dropdownoptions.oc.inspector') $inspectable.trigger(optionsEvent, [{ - values: values, + values: values, callback: callback, property: this.inspector.getPropertyPath(this.propertyDefinition.property), propertyDefinition: this.propertyDefinition @@ -434,4 +447,4 @@ } $.oc.inspector.propertyEditors.dropdown = DropdownEditor -}(window.jQuery); \ No newline at end of file +}(window.jQuery); diff --git a/modules/system/assets/ui/js/inspector.surface.js b/modules/system/assets/ui/js/inspector.surface.js index e536d1cde..a9b3e1375 100644 --- a/modules/system/assets/ui/js/inspector.surface.js +++ b/modules/system/assets/ui/js/inspector.surface.js @@ -28,9 +28,9 @@ * - containerElement container DOM element * - properties array (array of objects) * - values - property values, an object - * - inspectorUniqueId - a string containing the unique inspector identifier. - * The identifier should be a constant for an inspectable element. Use - * $.oc.inspector.helpers.generateElementUniqueId(element) to generate a persistent ID + * - inspectorUniqueId - a string containing the unique inspector identifier. + * The identifier should be a constant for an inspectable element. Use + * $.oc.inspector.helpers.generateElementUniqueId(element) to generate a persistent ID * for an element. Use $.oc.inspector.helpers.generateUniqueId() to generate an ID * not associated with an element. Inspector uses the ID for storing configuration * related to an element in the document DOM. @@ -138,7 +138,7 @@ // /** - * Builds the Inspector table. The markup generated by this method looks + * Builds the Inspector table. The markup generated by this method looks * like this: * *