diff --git a/src/editors/checkboxes.js b/src/editors/checkboxes.js index 74a42025..544d3f78 100644 --- a/src/editors/checkboxes.js +++ b/src/editors/checkboxes.js @@ -63,6 +63,7 @@ Form.editors.Checkboxes = Form.editors.Select.extend({ * @return {String} HTML */ _arrayToHtml: function (array) { + var $ = Backbone.$; var html = $(); var self = this; diff --git a/src/editors/select.js b/src/editors/select.js index e6e6bb67..9257d827 100644 --- a/src/editors/select.js +++ b/src/editors/select.js @@ -211,6 +211,7 @@ Form.editors.Select = Form.editors.Base.extend({ * @return {String} HTML */ _arrayToHtml: function(array) { + var $ = Backbone.$; var html = $(); //Generate HTML diff --git a/src/editors/textarea.js b/src/editors/textarea.js index 1362f39e..af15397a 100644 --- a/src/editors/textarea.js +++ b/src/editors/textarea.js @@ -10,6 +10,24 @@ Form.editors.TextArea = Form.editors.Text.extend({ */ initialize: function(options) { Form.editors.Base.prototype.initialize.call(this, options); + }, + + getValue: function () { + return this.$el.html(); + }, + + setValue: function (value) { + this.$el.html(value); + }, + + determineChange: function (event) { + var currentValue = this.$el.html(); + var changed = (currentValue !== this.previousValue); + + if (changed) { + this.previousValue = currentValue; + this.trigger('change', this); + } } });