Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22540: Slow loading time when changing the icons theme to Silk in the Icon picker #3537

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ define('xwiki-iconService', [
iconsPromise = iconsPromisesPerTheme[query] = $.getJSON(getResourceURL('data_icons', {
iconTheme,
query,
'metadata': 'true'
metadata: true
}));
iconsPromise.catch(() => {
// Reset the promise so that we can try again later.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
#set ($iconNamePrefix = $request.query.toLowerCase())
#foreach ($xwikiIcon in $xwikiIcons)
#if ("$!iconNamePrefix" == '' || $xwikiIcon.startsWith($iconNamePrefix))
#set($icon = {
#set ($icon = {
'name': $xwikiIcon,
'render': $services.icon.renderHTML($xwikiIcon, $iconTheme)
})
#if($request.metadata == 'true')
#set($discard = $icon.put('metadata', $services.icon.getMetaData($xwikiIcon, $iconTheme)))
#if ($request.metadata == 'true')
#set ($icon.metadata = $services.icon.getMetaData($xwikiIcon, $iconTheme))
#end
#set ($discard = $icons.add($icon))
#end
Expand Down Expand Up @@ -243,8 +243,7 @@ require(['jquery', 'xwiki-icon-picker'], function($) {
selectedIconName = currentInput[0].value.replace(currentInput.data('xwikiIconPickerSettings').prefix, '');
}
// For each icon
for (var i=0; i < iconList.length; ++i) {
let icon = iconList[i];
iconList.forEach(icon => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need a closing ) at the end (I couldn't add it as a code suggestion :) ).

// Display the icon
if (selectedIconName === '' || icon.name.includes(selectedIconName)) {
var displayer = $(document.createElement('div'));
Expand Down
Loading