jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/373858 )
Change subject: Propagate statementview changes to subwidgets
......................................................................
Propagate statementview changes to subwidgets
This is required to have snak hashes in the DOM, since the subwidgets
need to get the new snak hash.
Bug: T171725
Change-Id: Icaed0bf516cbb0467e5d642226a36191fbde440c
---
M view/resources/jquery/wikibase/jquery.wikibase.statementview.js
1 file changed, 17 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Thiemo Mättig (WMDE): Looks good to me, approved
diff --git a/view/resources/jquery/wikibase/jquery.wikibase.statementview.js
b/view/resources/jquery/wikibase/jquery.wikibase.statementview.js
index a50616d..579c366 100644
--- a/view/resources/jquery/wikibase/jquery.wikibase.statementview.js
+++ b/view/resources/jquery/wikibase/jquery.wikibase.statementview.js
@@ -719,11 +719,24 @@
if ( key === 'value' ) {
this.element.toggleClass( 'wb-new', value ===
null );
- if ( value && value.getClaim().getGuid() ) {
- this.element.addClass(
'wikibase-statement-' + value.getClaim().getGuid() );
- }
+ if ( value !== null ) {
+ if ( value.getClaim().getGuid() ) {
+ this.element.addClass(
'wikibase-statement-' + value.getClaim().getGuid() );
+ }
- // FIXME: Propagate external changes to all
sub-widgets? Not needed at the moment.
+ if ( this._mainSnakSnakView ) {
+ this._mainSnakSnakView.option(
key, value.getClaim().getMainSnak() );
+ }
+ if ( this._qualifiers ) {
+ this._qualifiers.option( key,
value.getClaim().getQualifiers() );
+ }
+ if ( this._rankSelector ) {
+ this._rankSelector.option( key,
value.getRank() );
+ }
+ if ( this._referencesListview ) {
+
this._referencesListview.option( key, value.getReferences() );
+ }
+ }
}
return response;
--
To view, visit https://gerrit.wikimedia.org/r/373858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icaed0bf516cbb0467e5d642226a36191fbde440c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits