Get HTML values working when sent in content

This commit is contained in:
Nathan Gray 2012-04-25 17:26:34 +00:00
parent cb6ad85fb3
commit 7f74846c93

View File

@ -18,7 +18,7 @@
et2_core_baseWidget; et2_core_baseWidget;
*/ */
var et2_html = et2_baseWidget.extend({ var et2_html = et2_valueWidget.extend({
init: function() { init: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
@ -32,7 +32,7 @@ var et2_html = et2_baseWidget.extend({
loadContent: function(_data) { loadContent: function(_data) {
// Create an object containg the given value and an empty js string // 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 // Seperate the javascript from the given html. The js code will be
// written to the previously created empty js string // 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 // Append the html to the parent element
this.htmlNode.append(html.html); this.htmlNode.append(html.html);
this.htmlNode.append(html.js); this.htmlNode.append(html.js);
},
set_value: function(_value) {
this.htmlNode.empty();
this.loadContent(_value);
} }
}); });