From 1e1f90af0ef4a18294bd9f9518c450f438580f5a Mon Sep 17 00:00:00 2001 From: Eugene Morozov Date: Fri, 26 Dec 2014 14:36:42 +0300 Subject: [PATCH 1/3] Fixed Select field rendering bug. --- src/editors/select.js | 1 + 1 file changed, 1 insertion(+) 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 From 65b40deb403b4bd35d5e498ed8f399d20bd39a60 Mon Sep 17 00:00:00 2001 From: Eugene Morozov Date: Mon, 29 Dec 2014 01:21:40 +0300 Subject: [PATCH 2/3] Fixed checkbox rendering when $ is not bound to jQuery. --- src/editors/checkboxes.js | 1 + 1 file changed, 1 insertion(+) 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; From 8ec9e3d422c1d57ab678b08e0dafa5165157edea Mon Sep 17 00:00:00 2001 From: Eugene Morozov Date: Mon, 29 Dec 2014 03:43:51 +0300 Subject: [PATCH 3/3] Fixed textarea editor. --- src/editors/textarea.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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); + } } });