From 3cfbcc8cf1cc342f3db10da8a9fc6e5bd12c76b3 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 19 Sep 2013 19:31:56 +0000 Subject: [PATCH] Trigger a load event when the template is loaded, to make it easier to work with the template when it is loaded from the server --- etemplate/js/et2_widget_template.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etemplate/js/et2_widget_template.js b/etemplate/js/et2_widget_template.js index 7e2c28f898..8e97289cc2 100644 --- a/etemplate/js/et2_widget_template.js +++ b/etemplate/js/et2_widget_template.js @@ -164,6 +164,16 @@ var et2_template = et2_DOMWidget.extend( getDOMNode: function() { return this.div; }, + + /** + * Override to trigger a load event, to facilitate processing when the xml file + * is loaded asyncronously + */ + doLoadingFinished: function() { + this._super.apply(this, arguments); + $j(this.getDOMNode()).trigger('load'); + return true; + } }); et2_register_widget(et2_template, ["template"]);