Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/164912
Change subject: First initialize sitelinklistview, then attach events ...................................................................... First initialize sitelinklistview, then attach events This improves performance substantially with a lot of sitelinks. Change-Id: Ife8dc884b75a473e99bd20fe3dfb821be52a709e (cherry picked from commit 40a149bb38aad093aca04e5273c493f3c5120103) --- M lib/resources/jquery.wikibase/jquery.wikibase.sitelinklistview.js 1 file changed, 18 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/12/164912/1 diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.sitelinklistview.js b/lib/resources/jquery.wikibase/jquery.wikibase.sitelinklistview.js index fce3526..ba1748c 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.sitelinklistview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.sitelinklistview.js @@ -122,6 +122,23 @@ // Encapsulate sitelinkviews by suppressing their events: this.$listview + .listview( { + listItemAdapter: new $.wikibase.listview.ListItemAdapter( { + listItemWidget: listItemWidget, + listItemWidgetValueAccessor: 'value', + newItemOptionsFn: function( value ) { + return { + value: value, + getAllowedSiteIds: function() { + return self._getUnusedAllowedSiteIds(); + }, + entityStore: self.options.entityStore + }; + } + } ), + value: self.options.value || null, + listItemNodeName: 'TR' + } ) .on( prefix + 'change.' + this.widgetName, function( event ) { event.stopPropagation(); self._trigger( 'change' ); @@ -179,24 +196,7 @@ self._refreshTableHeader(); self._trigger( 'change' ); } - ) - .listview( { - listItemAdapter: new $.wikibase.listview.ListItemAdapter( { - listItemWidget: listItemWidget, - listItemWidgetValueAccessor: 'value', - newItemOptionsFn: function( value ) { - return { - value: value, - getAllowedSiteIds: function() { - return self._getUnusedAllowedSiteIds(); - }, - entityStore: self.options.entityStore - }; - } - } ), - value: self.options.value || null, - listItemNodeName: 'TR' - } ); + ); }, /** -- To view, visit https://gerrit.wikimedia.org/r/164912 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife8dc884b75a473e99bd20fe3dfb821be52a709e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: wmf/1.25wmf1 Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Adrian Lang <adrian.l...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits