diff --git a/src/js/timepicker/index.js b/src/js/timepicker/index.js index 126c3ab..1973879 100644 --- a/src/js/timepicker/index.js +++ b/src/js/timepicker/index.js @@ -210,11 +210,16 @@ var TimePicker = snippet.defineClass(/** @lends TimePicker.prototype */ { * @private */ _setEvents: function() { + var type = 'change'; + if (snippet.browser.msie && snippet.browser.version === 8) { + type = 'click'; + } + this._hourInput.on('change', this._onChangeTimeInput, this); this._minuteInput.on('change', this._onChangeTimeInput, this); if (this._showMeridiem) { - domUtil.on(this._container, 'change', this._onChangeMeridiem, this); + domUtil.on(this._container, type, this._onChangeMeridiem, this); } }, @@ -229,7 +234,7 @@ var TimePicker = snippet.defineClass(/** @lends TimePicker.prototype */ { this._minuteInput.destroy(); if (this._showMeridiem) { - domUtil.off(this._container, 'change', this._onChangeMeridiem, this); + domUtil.off(this._container, 'change click', this._onChangeMeridiem, this); } }, diff --git a/src/js/timepicker/selectbox.js b/src/js/timepicker/selectbox.js index 42c7dfb..8ca1a50 100644 --- a/src/js/timepicker/selectbox.js +++ b/src/js/timepicker/selectbox.js @@ -125,7 +125,12 @@ var Selectbox = snippet.defineClass(/** @lends Selectbox.prototype */ { * @private */ _setEvents: function() { - domUtil.on(this._container, 'change', this._onChangeHandler, this); + var type = 'change'; + if (snippet.browser.msie && snippet.browser.version === 8) { + type = 'click'; + } + + domUtil.on(this._container, type, this._onChangeHandler, this); this.on('changeItems', function(items) { this._items = items; @@ -140,7 +145,7 @@ var Selectbox = snippet.defineClass(/** @lends Selectbox.prototype */ { _removeEvents: function() { this.off(); - domUtil.off(this._container, 'change', this._onChangeHandler, this); + domUtil.off(this._container, 'change click', this._onChangeHandler, this); }, /** diff --git a/src/js/timepicker/spinbox.js b/src/js/timepicker/spinbox.js index 580f7b4..079a920 100644 --- a/src/js/timepicker/spinbox.js +++ b/src/js/timepicker/spinbox.js @@ -137,9 +137,14 @@ var Spinbox = snippet.defineClass(/** @lends Spinbox.prototype */ { * @private */ _setEvents: function() { + var type = 'change'; + if (snippet.browser.msie && snippet.browser.version === 8) { + type = 'keyup'; + } + domUtil.on(this._container, 'click', this._onClickHandler, this); domUtil.on(this._container, 'keydown', this._onKeydownInputElement, this); - domUtil.on(this._container, 'change', this._onChangeHandler, this); + domUtil.on(this._container, type, this._onChangeHandler, this); this.on('changeItems', function(items) { this._items = items; @@ -156,7 +161,7 @@ var Spinbox = snippet.defineClass(/** @lends Spinbox.prototype */ { domUtil.off(this._container, 'click', this._onClickHandler, this); domUtil.off(this._container, 'keydown', this._onKeydownInputElement, this); - domUtil.off(this._container, 'change', this._onChangeHandler, this); + domUtil.off(this._container, 'change keyup', this._onChangeHandler, this); }, /**