From 1019046a0de04937a9f45c0197dc9bf8a79bfe5f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 20 Apr 2016 21:20:36 +0000 Subject: [PATCH] - Avoid changing content manager select options when reading from template tags - More checking with namespaced select options to avoid grabbing all children of a parent namespace --- api/js/etemplate/et2_widget_selectbox.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/api/js/etemplate/et2_widget_selectbox.js b/api/js/etemplate/et2_widget_selectbox.js index a4a3967dd8..ed6347d98f 100644 --- a/api/js/etemplate/et2_widget_selectbox.js +++ b/api/js/etemplate/et2_widget_selectbox.js @@ -425,6 +425,11 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend( // Read the option-tags var options = et2_directChildrenByTagName(_node, "option"); + if(options.length) + { + // Break reference to content manager, we don't want to add to it + this.options.select_options = jQuery.extend({},this.options.select_options); + } var egw = this.egw(); for (var i = 0; i < options.length; i++) { @@ -917,6 +922,20 @@ jQuery.extend(et2_selectbox, //(function(){ "use strict"; return { content_options = content_options[last]; } + else if (content_options) + { + // Check for real values + for(var key in content_options) + { + if(!(isNaN(key) && typeof content_options[key] === 'string' || + !isNaN(key) && typeof content_options[key] === 'object' && typeof content_options[key]['value'] !== 'undefined')) + { + // Found a parent of some other namespace + content_options = undefined; + break; + } + } + } } }