From 947c2f0462fe9552b16818b734d41e17880c9f99 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 4 Mar 2014 16:05:38 +0000 Subject: [PATCH] not visible nextmatch will run refresh when it becomes visible again (not just ignoring it) --- etemplate/js/et2_extension_nextmatch.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 3291069366..563e76ce3a 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -453,11 +453,19 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], */ refresh: function(_row_ids, _type) { // Framework trying to refresh, but nextmatch not fully initialized - if(this.controller === null || !this.div || !this.div.is(':visible')) + if(this.controller === null || !this.div) { return; } - + if (!this.div.is(':visible')) // run refresh, once we become visible again + { + $j(this.getInstanceManager().DOMContainer.parentNode).one('show.et2_nextmatch', + // Important to use anonymous function instead of just 'this.refresh' because + // of the parameters passed + jQuery.proxy(function() {this.refresh();},this) + ); + return; + } if (typeof _type == 'undefined') _type = 'edit'; if (typeof _row_ids == 'string' || typeof _row_ids == 'number') _row_ids = [_row_ids]; if (typeof _row_ids == "undefined" || _row_ids === null)