From 3c80defe8bfaed2d3a88bff5383bcdef01ed25c3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 11 Oct 2013 09:55:12 +0000 Subject: [PATCH] fixed setFilter to correctly return all current filter-values in its 1. parameter this.activeFilters --- etemplate/js/et2_extension_nextmatch.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 70e565d0a6..bdc0a73a07 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -1821,7 +1821,8 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, if(typeof child.set_value != "undefined" && child.id) { value = mgr.getEntry(child.id); - child.set_value(value == null ? "" : value); + if (value == null) value = ''; + child.set_value(value); } if(typeof child.get_value == "function" && child.id) { @@ -1832,17 +1833,19 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, // Split up indexes var indexes = child.id.replace('[','[').split('['); - if(indexes.length > 1) + for(var i = 0; i < indexes.length; i++) { - for(var i = 0; i < indexes.length; i++) { - indexes[i] = indexes[i].replace(']','').replace(']',''); - if(typeof target[indexes[i]] == "undefined") { - target[indexes[i]] = i == indexes.length-1 ? value : {}; - } + indexes[i] = indexes[i].replace(']','').replace(']',''); + if (i < indexes.length-1) + { + if(typeof target[indexes[i]] == "undefined") target[indexes[i]] = {}; target = target[indexes[i]]; } + else + { + target[indexes[i]] = value; + } } - target = value; } }, filters);