jenkins-bot has submitted this change and it was merged.

Change subject: Prevent "movetoolbar" initialization on pending claims
......................................................................


Prevent "movetoolbar" initialization on pending claims

Since there are no proper tests yet, initialization of the "movetoolbar" on 
pending claims
is disabled since it may cause undesired side effects.

Change-Id: I41cbb6c55c217d784d5fbd51a5e0058aef12e4ed
---
M lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
index 937643d..09dd9b9 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.claimgrouplistview.js
@@ -372,12 +372,19 @@
                                $claimlistview = $claimview.closest( 
':wikibase-claimlistview' ),
                                claimlistview = $claimlistview.data( 
'claimlistview' ),
                                claimlistviewListview = 
claimlistview.$listview.data( 'listview' ),
+                               claimview = 
claimlistviewListview.listItemAdapter().liInstance( $claimview ),
                                $claimviews = claimlistviewListview.items(),
                                $claimgrouplistview = $claimlistview.closest( 
':wikibase-claimgrouplistview' ),
                                claimgrouplistview = $claimgrouplistview.data( 
'claimgrouplistview' ),
                                claimgrouplistviewListview = 
claimgrouplistview.$listview.data( 'listview' ),
                                $claimlistviews = 
claimgrouplistviewListview.items();
 
+                       if( !claimview.value() ) {
+                               // Do not initialize the movetoolbar when the 
claim is pending since that might
+                               // cause disturbances with the indices.
+                               return;
+                       }
+
                        $claimview.movetoolbar();
 
                        // If the claimview is the topmost claimview in the 
topmost claimgroup, the "move up"

-- 
To view, visit https://gerrit.wikimedia.org/r/99346
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I41cbb6c55c217d784d5fbd51a5e0058aef12e4ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to