Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/93459
Change subject: TimeInput expert: Updating input extender content only when active ...................................................................... TimeInput expert: Updating input extender content only when active Removed obsolete "eachchange" event handler since its actions were redundant with the "timeinputupdate" event handler. The input extender contents are updated only when the input extender is active preventing running into errors when the input extender contents could not be accessed. Change-Id: Icb8474dc4995b2b02dbf52a42626947b15961c1a --- M ValueView/resources/jquery.valueview/valueview.experts/experts.TimeInput.js 1 file changed, 7 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/59/93459/1 diff --git a/ValueView/resources/jquery.valueview/valueview.experts/experts.TimeInput.js b/ValueView/resources/jquery.valueview/valueview.experts/experts.TimeInput.js index 8748438..2c50c9d 100644 --- a/ValueView/resources/jquery.valueview/valueview.experts/experts.TimeInput.js +++ b/ValueView/resources/jquery.valueview/valueview.experts/experts.TimeInput.js @@ -101,13 +101,6 @@ 'class': this.uiBaseClass + '-input valueview-input' } ) .appendTo( this.$viewPort ) - .eachchange( function( event, oldValue ) { - var value = self.$input.data( 'timeinput' ).value(); - if( oldValue === '' && value === null || self.$input.val() === '' ) { - self._updatePreview(); - self._updateCalendarHint(); - } - } ) .timeinput( { mediaWiki: this._options.mediaWiki } ) .inputextender( { initCallback: function( $extension ) { @@ -127,14 +120,16 @@ contentAnimationEvents: 'toggleranimation' } ) .on( 'timeinputupdate.' + this.uiBaseClass, function( event, value ) { - self._updateCalendarHint( value ); - if( value ) { - self.$precision.data( 'listrotator' ).rotate( value.precision() ); - self.$calendar.data( 'listrotator' ).rotate( value.calendar() ); + if( self.$input.data( 'inputextender' ).extensionIsActive() ) { + self._updateCalendarHint( value ); + if( value ) { + self.$precision.data( 'listrotator' ).rotate( value.precision() ); + self.$calendar.data( 'listrotator' ).rotate( value.calendar() ); + } + self._updatePreview(); } self._newValue = false; // value, not yet handled by draw(), is outdated now self._viewNotifier.notify( 'change' ); - self._updatePreview(); } ); }, -- To view, visit https://gerrit.wikimedia.org/r/93459 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb8474dc4995b2b02dbf52a42626947b15961c1a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Henning Snater <henning.sna...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits