mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
Update combobox when contents are changed.
This commit is contained in:
parent
b1e524e9c3
commit
fa6ff26061
1 changed files with 9 additions and 0 deletions
|
@ -58,6 +58,10 @@ Discourse.ComboboxView = Discourse.View.extend({
|
||||||
$combo.trigger("liszt:updated");
|
$combo.trigger("liszt:updated");
|
||||||
}.observes('value'),
|
}.observes('value'),
|
||||||
|
|
||||||
|
contentChanged: function() {
|
||||||
|
this.rerender();
|
||||||
|
}.observes('content.@each'),
|
||||||
|
|
||||||
didInsertElement: function() {
|
didInsertElement: function() {
|
||||||
var $elem = this.$(),
|
var $elem = this.$(),
|
||||||
self = this;
|
self = this;
|
||||||
|
@ -80,6 +84,11 @@ Discourse.ComboboxView = Discourse.View.extend({
|
||||||
$elem.chosen().change(function(e) {
|
$elem.chosen().change(function(e) {
|
||||||
self.set('value', $(e.target).val());
|
self.set('value', $(e.target).val());
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
willClearRender: function() {
|
||||||
|
var chosenId = this.$().attr('id') + "_chzn";
|
||||||
|
Ember.$("#" + chosenId).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue