mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
code cleanup
This commit is contained in:
parent
0d7accc990
commit
064a5f5564
@ -272,12 +272,6 @@
|
||||
function dragDropTabs(draggingTabs, targetTabs) {
|
||||
if (draggingTabs.find(x => targetTabs.find(y => x.tabid == y.tabid))) return;
|
||||
|
||||
// if (getTabDbKey(draggingTab) != getTabDbKey(targetTab)) {
|
||||
// // dragDropDbKey(getTabDbKey(draggingTab), getTabDbKey(targetTab));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// const dbKey = getTabDbKey(draggingTab);
|
||||
const items = sortTabs($openedTabs.filter(x => x.closedTime == null));
|
||||
const dstIndexes = targetTabs.map(targetTab => _.findIndex(items, x => x.tabid == targetTab.tabid));
|
||||
const dstIndexFirst = _.min(dstIndexes) as number;
|
||||
@ -314,39 +308,6 @@
|
||||
);
|
||||
}
|
||||
|
||||
// function dragDropDbKey(draggingDbKey, targetDbKey) {
|
||||
// if (!draggingDbKey) return;
|
||||
// if (targetDbKey == draggingDbKey) return;
|
||||
|
||||
// const groupOrderFiltered = _.pickBy($tabDatabaseGroupOrder, (v, k) =>
|
||||
// $openedTabs.filter(x => x.closedTime == null).find(x => getTabDbKey(x) == k)
|
||||
// );
|
||||
|
||||
// const items = _.sortBy(_.keys(groupOrderFiltered), x => groupOrderFiltered[x]);
|
||||
|
||||
// const dstIndex = _.indexOf(items, targetDbKey);
|
||||
// const srcIndex = _.indexOf(items, draggingDbKey);
|
||||
// if (srcIndex < 0 || dstIndex < 0) {
|
||||
// console.warn('Drag tab group index not found');
|
||||
// return;
|
||||
// }
|
||||
// const newItems =
|
||||
// dstIndex < srcIndex
|
||||
// ? [...items.slice(0, dstIndex), draggingDbKey, ...items.slice(dstIndex).filter(x => x != draggingDbKey)]
|
||||
// : [
|
||||
// ...items.slice(0, dstIndex + 1).filter(x => x != draggingDbKey),
|
||||
// draggingDbKey,
|
||||
// ...items.slice(dstIndex + 1),
|
||||
// ];
|
||||
|
||||
// const newGroupOrder = {};
|
||||
// for (const key in groupOrderFiltered) {
|
||||
// const index = newItems.indexOf(key);
|
||||
// newGroupOrder[key] = index >= 0 ? index + 1 : groupOrderFiltered[key];
|
||||
// }
|
||||
|
||||
// tabDatabaseGroupOrder.set(newGroupOrder);
|
||||
// }
|
||||
</script>
|
||||
|
||||
{#each groupedTabs as tabGroup}
|
||||
|
Loading…
Reference in New Issue
Block a user