Add caching for language option list items

This commit is contained in:
NikG
2022-11-10 13:27:28 +02:00
committed by Niklas Laxström
parent f3f14a2098
commit d7f7927ec3

View File

@@ -55,6 +55,7 @@
this.$element.addClass( 'uls-lcd' );
this.regionLanguages = {};
this.$languageOptionListItems = null;
this.renderTimeout = null;
this.$cachedQuicklist = null;
this.groupByRegionOverride = null;
@@ -79,7 +80,11 @@
* @return {jQuery}
*/
getLanguageOptionListItems: function () {
return this.$element.find( 'li[data-code]' );
if ( !this.$languageOptionListItems ) {
this.$languageOptionListItems = this.$element.find( 'li[data-code]' );
}
return this.$languageOptionListItems;
},
/**