fix: export attachTreeItemActionButton/LongPress from viewer.js, import in sidebar.js
This commit is contained in:
@@ -3,7 +3,7 @@ import { safeCreateIcons, getFileIcon } from './utils.js';
|
|||||||
import { api } from './auth.js';
|
import { api } from './auth.js';
|
||||||
import { populateCustomDropdown } from './ui.js';
|
import { populateCustomDropdown } from './ui.js';
|
||||||
import { _populateRecentVaultFilter } from './config.js';
|
import { _populateRecentVaultFilter } from './config.js';
|
||||||
import { el, icon, getVaultIcon, smallBadge } from './viewer.js';
|
import { el, icon, getVaultIcon, smallBadge, attachTreeItemActionButton, attachTreeItemLongPress } from './viewer.js';
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Vault context switching
|
// Vault context switching
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ function getContextMenuPositionFromElement(target) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function attachTreeItemActionButton(itemEl, vault, path, type, isReadonly) {
|
export function attachTreeItemActionButton(itemEl, vault, path, type, isReadonly) {
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
button.type = "button";
|
button.type = "button";
|
||||||
button.className = "tree-item-action-btn";
|
button.className = "tree-item-action-btn";
|
||||||
@@ -668,7 +668,7 @@ function attachTreeItemActionButton(itemEl, vault, path, type, isReadonly) {
|
|||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function attachTreeItemLongPress(itemEl, getMenuData) {
|
export function attachTreeItemLongPress(itemEl, getMenuData) {
|
||||||
let pressTimer = null;
|
let pressTimer = null;
|
||||||
let pressHandled = false;
|
let pressHandled = false;
|
||||||
let startX = 0;
|
let startX = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user