BUG Add a synthetic event to workaround IE8 issues.

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).
This commit is contained in:
Mateusz Uzdowski 2014-07-31 15:38:47 +12:00
parent c02ff14db8
commit d8302a0ab7

View File

@ -173,7 +173,11 @@
}, },
setValue: function(val) { setValue: function(val) {
this.data('metadata', $.extend(this.data('metadata'), {id: 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() { getValue: function() {
return this.find(':input:hidden').val(); return this.find(':input:hidden').val();