mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Revert "FIX: Broken comboboxes. Workaround Ember bug that needs triaging"
This reverts commit d1cb946594
.
This commit is contained in:
parent
6d1321192a
commit
08501f53b4
1 changed files with 3 additions and 5 deletions
|
@ -7,7 +7,7 @@
|
||||||
@module Discourse
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
export default Discourse.View.extend({
|
export default Discourse.View.extend({
|
||||||
tagName: 'span',
|
tagName: 'select',
|
||||||
attributeBindings: ['tabindex'],
|
attributeBindings: ['tabindex'],
|
||||||
classNames: ['combobox'],
|
classNames: ['combobox'],
|
||||||
valueAttribute: 'id',
|
valueAttribute: 'id',
|
||||||
|
@ -27,7 +27,6 @@ export default Discourse.View.extend({
|
||||||
none = this.get('none');
|
none = this.get('none');
|
||||||
|
|
||||||
// Add none option if required
|
// Add none option if required
|
||||||
buffer.push('<select class=\'combobox\'>');
|
|
||||||
if (typeof none === "string") {
|
if (typeof none === "string") {
|
||||||
buffer.push('<option value="">' + I18n.t(none) + "</option>");
|
buffer.push('<option value="">' + I18n.t(none) + "</option>");
|
||||||
} else if (typeof none === "object") {
|
} else if (typeof none === "object") {
|
||||||
|
@ -47,11 +46,10 @@ export default Discourse.View.extend({
|
||||||
buffer.push("<option " + selectedText + " value=\"" + val + "\" " + self.buildData(o) + ">" + Handlebars.Utils.escapeExpression(Em.get(o, nameProperty)) + "</option>");
|
buffer.push("<option " + selectedText + " value=\"" + val + "\" " + self.buildData(o) + ">" + Handlebars.Utils.escapeExpression(Em.get(o, nameProperty)) + "</option>");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
buffer.push('</select>');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
valueChanged: function() {
|
valueChanged: function() {
|
||||||
var $combo = this.$('select'),
|
var $combo = this.$(),
|
||||||
val = this.get('value');
|
val = this.get('value');
|
||||||
if (val !== undefined && val !== null) {
|
if (val !== undefined && val !== null) {
|
||||||
$combo.val(val.toString());
|
$combo.val(val.toString());
|
||||||
|
@ -66,7 +64,7 @@ export default Discourse.View.extend({
|
||||||
}.observes('content.@each'),
|
}.observes('content.@each'),
|
||||||
|
|
||||||
didInsertElement: function() {
|
didInsertElement: function() {
|
||||||
var $elem = this.$('select'),
|
var $elem = this.$(),
|
||||||
self = this;
|
self = this;
|
||||||
|
|
||||||
$elem.select2({formatResult: this.template, minimumResultsForSearch: 5, width: 'resolve'});
|
$elem.select2({formatResult: this.template, minimumResultsForSearch: 5, width: 'resolve'});
|
||||||
|
|
Loading…
Reference in a new issue