Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/135566
Change subject: Focus snakview variation only when viewState is enabled ...................................................................... Focus snakview variation only when viewState is enabled Fixes issues with main snak value disappearing when saving qualifiers, setting rank, and javascript freezing / throwing errors, and other related issues. When snakview variation value view / viewState is disabled, the qualifier and/or main snak value may become null and cause these issues when saving. This preserves focus behaviour when selecting a property, then autofocusing on the value. Bug: 64651 Bug: 65694 Bug: 65693 Bug: 65398 Change-Id: I0f39f7500597f8e1488d922ab115199d92399ecb (cherry picked from commit 4751b1b8b58a7c82c0e4398672aa38612f197685) --- M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/66/135566/1 diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js index 609fbd0..b68dbbd 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js @@ -106,6 +106,8 @@ self._valueView.enable(); } } + + $( self ).trigger( 'afterdraw' ); } /** @@ -202,12 +204,9 @@ ); _render(); - - $( self ).trigger( 'afterdraw' ); } ); } else { _render(); - $( self ).trigger( 'afterdraw' ); } }, @@ -344,7 +343,7 @@ * @see jQuery.wikibase.snakview.variations.Variation.focus */ focus: function() { - if( this._valueView ) { + if( this._valueView && this._viewState.isDisabled() === false ) { this._valueView.focus(); } }, -- To view, visit https://gerrit.wikimedia.org/r/135566 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f39f7500597f8e1488d922ab115199d92399ecb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.24-wmf6 Gerrit-Owner: Aude <aude.w...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits