mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -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");
|
||||
}.observes('value'),
|
||||
|
||||
contentChanged: function() {
|
||||
this.rerender();
|
||||
}.observes('content.@each'),
|
||||
|
||||
didInsertElement: function() {
|
||||
var $elem = this.$(),
|
||||
self = this;
|
||||
|
@ -80,6 +84,11 @@ Discourse.ComboboxView = Discourse.View.extend({
|
|||
$elem.chosen().change(function(e) {
|
||||
self.set('value', $(e.target).val());
|
||||
});
|
||||
},
|
||||
|
||||
willClearRender: function() {
|
||||
var chosenId = this.$().attr('id') + "_chzn";
|
||||
Ember.$("#" + chosenId).remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue