feature: client: sort: migrate to ESM

This commit is contained in:
coderiaser 2026-01-15 18:02:54 +02:00
parent 917f585137
commit e27ef51d43

View file

@ -1,31 +0,0 @@
'use strict';
/* global CloudCmd */
const DOM = require('./dom');
const Info = DOM.CurrentInfo;
const {sort, order} = CloudCmd;
const position = DOM.getPanelPosition();
let sortPrevious = sort[position];
const {getPanel} = DOM;
CloudCmd.sortPanel = (name, panel = getPanel()) => {
const position = panel.dataset.name.replace('js-', '');
if (name !== sortPrevious)
order[position] = 'asc';
else if (order[position] === 'asc')
order[position] = 'desc';
else
order[position] = 'asc';
sortPrevious = name;
sort[position] = name;
const noCurrent = position !== Info.panelPosition;
CloudCmd.refresh({
panel,
noCurrent,
});
};