[eGroupWare-svn] r55791 - /trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js

[email protected]
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: nathangray
Date: Wed Apr 20 23:20:36 2016
New Revision: 55791

URL: http://svn.stylite.de/viewvc/egroupware?rev=55791&view=rev
Log:
- 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

Modified:
    trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js

Modified: trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js?rev=55791&r1=55790&r2=55791&view=diff
==============================================================================
--- trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js (original)
+++ trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js Wed Apr 20 23:20:36 2016
@@ -425,6 +425,11 @@
 
 		// 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++)
 		{
@@ -916,6 +921,20 @@
 					if(content_options && typeof content_options[last] != 'undefined' && content_options[last] )
 					{
 						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;
+							}
+						}
 					}
 				}
 			}


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.