From bff821e300a3c85291b591f0d30cdd73c0b60d7b Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 27 May 2014 20:16:02 +0000 Subject: [PATCH] Move special path handling from nextmatch up to top level so it can work for all widgets with a namespace and their own value --- etemplate/js/et2_core_widget.js | 7 ++++++- etemplate/js/et2_extension_nextmatch.js | 6 ------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/etemplate/js/et2_core_widget.js b/etemplate/js/et2_core_widget.js index df11e8424d..cc1fdf5fcf 100644 --- a/etemplate/js/et2_core_widget.js +++ b/etemplate/js/et2_core_widget.js @@ -1032,7 +1032,12 @@ var et2_widget = ClassWithAttributes.extend( * this, but some extensions need to override this */ getPath: function() { - return this.getArrayMgr("content").getPath(); + var path = this.getArrayMgr("content").getPath(); + + // Prevent namespaced widgets with value from going an extra layer deep + if(this.id && this.createNamespace && path[path.length -1] == this.id) path.pop(); + + return path; } }); diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 0bdb2723d0..cbf17dc6d8 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -1674,12 +1674,6 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], return null; }, - getPath: function() { - var path = this._super.apply(this,arguments); - if(this.id && path[path.length -1] == this.id) path.pop(); - return path; - }, - // Input widget /**