Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions distribution.amd/backbone-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ Form.editors.Select = Form.editors.Base.extend({
* @return {String} HTML
*/
_arrayToHtml: function(array) {
var html = $();
var html = document.createDocumentFragment();

//Generate HTML
_.each(array, function(option) {
Expand All @@ -1795,14 +1795,14 @@ Form.editors.Select = Form.editors.Base.extend({
var optgroup = $("<optgroup>")
.attr("label",option.group)
.html( this._getOptionsHtml(option.options) );
html = html.add(optgroup);
html.appendChild(optgroup[0]);
} else {
var val = (option.val || option.val === 0) ? option.val : '';
html = html.add( $('<option>').val(val).text(option.label) );
html.appendChild( $('<option>').val(val).text(option.label)[0] );
}
}
else {
html = html.add( $('<option>').text(option) );
html.appendChild( $('<option>').text(option)[0] );
}
}, this);

Expand Down Expand Up @@ -1990,7 +1990,7 @@ Form.editors.Checkboxes = Form.editors.Select.extend({
* @return {String} HTML
*/
_arrayToHtml: function (array) {
var html = $();
var html = document.createDocumentFragment();
var self = this;

_.each(array, function(option, index) {
Expand Down Expand Up @@ -2018,7 +2018,7 @@ Form.editors.Checkboxes = Form.editors.Select.extend({
itemHtml.append( $('<input type="checkbox" name="'+self.getName()+'" id="'+self.id+'-'+index+'" />').val(option) );
itemHtml.append( $('<label for="'+self.id+'-'+index+'">').text(option) );
}
html = html.add(itemHtml);
html.appendChild(itemHtml[0]);
});

return html;
Expand Down
2 changes: 1 addition & 1 deletion distribution.amd/backbone-forms.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions distribution/backbone-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ Form.editors.Select = Form.editors.Base.extend({
* @return {String} HTML
*/
_arrayToHtml: function(array) {
var html = $();
var html = document.createDocumentFragment();

//Generate HTML
_.each(array, function(option) {
Expand All @@ -1806,14 +1806,14 @@ Form.editors.Select = Form.editors.Base.extend({
var optgroup = $("<optgroup>")
.attr("label",option.group)
.html( this._getOptionsHtml(option.options) );
html = html.add(optgroup);
html.appendChild(optgroup[0]);
} else {
var val = (option.val || option.val === 0) ? option.val : '';
html = html.add( $('<option>').val(val).text(option.label) );
html.appendChild( $('<option>').val(val).text(option.label)[0] );
}
}
else {
html = html.add( $('<option>').text(option) );
html.appendChild( $('<option>').text(option)[0] );
}
}, this);

Expand Down Expand Up @@ -2001,7 +2001,7 @@ Form.editors.Checkboxes = Form.editors.Select.extend({
* @return {String} HTML
*/
_arrayToHtml: function (array) {
var html = $();
var html = document.createDocumentFragment();
var self = this;

_.each(array, function(option, index) {
Expand Down Expand Up @@ -2029,7 +2029,7 @@ Form.editors.Checkboxes = Form.editors.Select.extend({
itemHtml.append( $('<input type="checkbox" name="'+self.getName()+'" id="'+self.id+'-'+index+'" />').val(option) );
itemHtml.append( $('<label for="'+self.id+'-'+index+'">').text(option) );
}
html = html.add(itemHtml);
html.appendChild(itemHtml[0]);
});

return html;
Expand Down
2 changes: 1 addition & 1 deletion distribution/backbone-forms.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/editors/checkboxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Form.editors.Checkboxes = Form.editors.Select.extend({
* @return {String} HTML
*/
_arrayToHtml: function (array) {
var html = $();
var html = document.createDocumentFragment();
var self = this;

_.each(array, function(option, index) {
Expand Down Expand Up @@ -91,7 +91,7 @@ Form.editors.Checkboxes = Form.editors.Select.extend({
itemHtml.append( $('<input type="checkbox" name="'+self.getName()+'" id="'+self.id+'-'+index+'" />').val(option) );
itemHtml.append( $('<label for="'+self.id+'-'+index+'">').text(option) );
}
html = html.add(itemHtml);
html.appendChild(itemHtml[0]);
});

return html;
Expand Down
8 changes: 4 additions & 4 deletions src/editors/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Form.editors.Select = Form.editors.Base.extend({
* @return {String} HTML
*/
_arrayToHtml: function(array) {
var html = $();
var html = document.createDocumentFragment();

//Generate HTML
_.each(array, function(option) {
Expand All @@ -220,14 +220,14 @@ Form.editors.Select = Form.editors.Base.extend({
var optgroup = $("<optgroup>")
.attr("label",option.group)
.html( this._getOptionsHtml(option.options) );
html = html.add(optgroup);
html.appendChild(optgroup[0]);
} else {
var val = (option.val || option.val === 0) ? option.val : '';
html = html.add( $('<option>').val(val).text(option.label) );
html.appendChild( $('<option>').val(val).text(option.label)[0] );
}
}
else {
html = html.add( $('<option>').text(option) );
html.appendChild( $('<option>').text(option)[0] );
}
}, this);

Expand Down