feature: cloudcmd: migrate to ESM

This commit is contained in:
coderiaser 2026-02-03 15:03:49 +02:00
parent e8a81c49ea
commit 4533a25c6f
184 changed files with 339 additions and 388 deletions

36
client/sort.js Normal file
View file

@ -0,0 +1,36 @@
/* global CloudCmd */
import {fullstore} from 'fullstore';
import DOM from '#dom';
const sortPrevious = fullstore();
const {getPanel} = DOM;
export const initSortPanel = () => {
const {sort} = CloudCmd;
const position = DOM.getPanelPosition();
sortPrevious(sort[position]);
};
export const sortPanel = (name, panel = getPanel()) => {
const {sort, order} = CloudCmd;
const Info = DOM.CurrentInfo;
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,
});
};