I guess jQuery adapter doesn't work quite yet, fix get/set_value()

This commit is contained in:
Nathan Gray 2012-06-12 20:50:45 +00:00
parent a7654f7952
commit 19991fe899

View File

@ -76,18 +76,28 @@ var et2_htmlarea = et2_inputWidget.extend({
doLoadingFinished: function() { doLoadingFinished: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.htmlNode.ckeditor(function() {},this.ck_props); var self = this;
this.htmlNode.ckeditor(function() {
// If value is set, pass it in here.
this.setData(self.value);
delete self.value;
},this.ck_props);
}, },
destroy: function() { destroy: function() {
this.htmlNode.ckeditorGet().destroy(true); this.htmlNode.ckeditorGet().destroy(true);
}, },
set_value: function(_value) { set_value: function(_value) {
this.htmlNode.val(_value); try {
this.htmlNode.ckeditorGet().setData(_value);
} catch (e) {
// CK editor not ready - callback will do it
this.value = _value;
}
}, },
getValue: function() { getValue: function() {
return this.htmlNode.val(); return this.htmlNode.ckeditorGet().getData();
} }
}); });