From 7f74846c930d5c16b2dedfba32fc12ce39e10bcf Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 25 Apr 2012 17:26:34 +0000 Subject: [PATCH] Get HTML values working when sent in content --- etemplate/js/et2_widget_html.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_html.js b/etemplate/js/et2_widget_html.js index 495fa80597..0d6570d624 100644 --- a/etemplate/js/et2_widget_html.js +++ b/etemplate/js/et2_widget_html.js @@ -18,7 +18,7 @@ et2_core_baseWidget; */ -var et2_html = et2_baseWidget.extend({ +var et2_html = et2_valueWidget.extend({ init: function() { this._super.apply(this, arguments); @@ -32,7 +32,7 @@ var et2_html = et2_baseWidget.extend({ loadContent: function(_data) { // Create an object containg the given value and an empty js string - var html = {html: value, js: ''}; + var html = {html: _data ? _data : '', js: ''}; // Seperate the javascript from the given html. The js code will be // written to the previously created empty js string @@ -41,6 +41,11 @@ var et2_html = et2_baseWidget.extend({ // Append the html to the parent element this.htmlNode.append(html.html); this.htmlNode.append(html.js); + }, + + set_value: function(_value) { + this.htmlNode.empty(); + this.loadContent(_value); } });