Moved applyChosen() function from \skins\classic\includes\functions.php

Also moved the call to applyChosen() after loading the document
pull/3910/head
IgorA100 2024-03-28 17:50:02 +03:00 committed by GitHub
parent 9068a5be85
commit 200815e2c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -373,6 +373,8 @@ if ( currentView != 'none' && currentView != 'login' ) {
.done(optionhelpModal)
.fail(logAjaxFail);
});
applyChosen();
});
// After retieving modal html via Ajax, this will insert it into the DOM
@ -1100,6 +1102,15 @@ function isMobile() {
return result;
}
function applyChosen() {
const limit_search_threshold = 10;
$j('.chosen').chosen('destroy');
$j('.chosen').not('.chosen-full-width, .chosen-auto-width').chosen({disable_search_threshold: limit_search_threshold});
$j('.chosen.chosen-full-width').chosen({disable_search_threshold: limit_search_threshold, width: "100%"});
$j('.chosen.chosen-auto-width').chosen({disable_search_threshold: limit_search_threshold, width: "auto"});
}
const font = new FontFaceObserver('Material Icons', {weight: 400});
font.load().then(function() {
$j('.material-icons').css('display', 'inline-block');