fix issue with version sort
This commit is contained in:
parent
4f4fff717f
commit
3489d716b2
1 changed files with 5 additions and 1 deletions
|
@ -22,6 +22,10 @@ function populateHistory(packageInfo, page) {
|
||||||
function populateVersions(packageInfo, page, installedPlugin) {
|
function populateVersions(packageInfo, page, installedPlugin) {
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
|
packageInfo.versions.sort((a, b) => {
|
||||||
|
return b.timestamp < a.timestamp ? 1 : -1;
|
||||||
|
});
|
||||||
|
|
||||||
for (let i = 0; i < packageInfo.versions.length; i++) {
|
for (let i = 0; i < packageInfo.versions.length; i++) {
|
||||||
const version = packageInfo.versions[i];
|
const version = packageInfo.versions[i];
|
||||||
html += '<option value="' + version.version + '">' + globalize.translate('PluginFromRepo', version.version, version.repositoryName) + '</option>';
|
html += '<option value="' + version.version + '">' + globalize.translate('PluginFromRepo', version.version, version.repositoryName) + '</option>';
|
||||||
|
@ -33,7 +37,7 @@ function populateVersions(packageInfo, page, installedPlugin) {
|
||||||
$('#pCurrentVersion', page).hide().html('');
|
$('#pCurrentVersion', page).hide().html('');
|
||||||
}
|
}
|
||||||
|
|
||||||
const packageVersion = packageInfo.versions.sort().pop();
|
const packageVersion = packageInfo.versions.pop();
|
||||||
if (packageVersion) {
|
if (packageVersion) {
|
||||||
selectmenu.val(packageVersion.version);
|
selectmenu.val(packageVersion.version);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue