Skip to content

Commit

Permalink
BUG Add a synthetic event to workaround IE8 issues.
Browse files Browse the repository at this point in the history
Without this event it's not possible to hook into the value change in a
reliable way (panelhide event is called too many times to rely on it).
  • Loading branch information
mateusz committed Jul 31, 2014
1 parent c02ff14 commit d8302a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion javascript/TreeDropdownField.js
Expand Up @@ -173,7 +173,11 @@
},
setValue: function(val) {
this.data('metadata', $.extend(this.data('metadata'), {id: val}));
this.find(':input:hidden').val(val).trigger('change');
this.find(':input:hidden').val(val)
// Trigger synthetic event so subscribers can workaround the IE8 problem with 'change' events
// not propagating on hidden inputs. 'change' is still triggered for backwards compatiblity.
.trigger('valueupdated')
.trigger('change');
},
getValue: function() {
return this.find(':input:hidden').val();
Expand Down

0 comments on commit d8302a0

Please sign in to comment.