调整模型预览下载按钮位置
This commit is contained in:
@@ -155,13 +155,12 @@ export function openModelPreview(
|
||||
<div class="preview-scene-section">
|
||||
<div class="preview-scene-body">
|
||||
<div class="preview-scene-actions">
|
||||
<button id="previewImportSceneBtn" class="primary-btn" type="button">导入</button>
|
||||
<button id="previewDownloadBtn" type="button">下载</button>
|
||||
</div>
|
||||
<button id="previewImportSceneBtn" class="primary-btn" type="button">导入场景</button>
|
||||
<label class="preview-switch">
|
||||
<input id="previewUseBasePoint" type="checkbox" />
|
||||
<span>启用基点</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="preview-basepoint-grid">
|
||||
<label><span>X</span><input name="baseX" type="number" value="0" step="0.001" /></label>
|
||||
@@ -182,6 +181,9 @@ export function openModelPreview(
|
||||
</div>
|
||||
`,
|
||||
actions: {
|
||||
下载() {
|
||||
bindDownloadModel(model);
|
||||
},
|
||||
更新缩略图() {
|
||||
if (canWrite) {
|
||||
screenshotModel(model.id, onThumbnailSaved).catch((error) => {
|
||||
@@ -201,7 +203,6 @@ export function openModelPreview(
|
||||
console.log(popup)
|
||||
bindProcessPlaceholder(operations);
|
||||
bindImportScene(model, operations, options.onImportScene);
|
||||
bindDownloadModel(model);
|
||||
if (canWrite) bindThumbnailCapture(model.id, onThumbnailSaved);
|
||||
requestAnimationFrame(() => {
|
||||
initPreview(url, context).catch((error) => {
|
||||
@@ -583,14 +584,12 @@ function bindImportScene(
|
||||
});
|
||||
}
|
||||
|
||||
function bindDownloadModel(model: ModelItem) {
|
||||
document.querySelector<HTMLButtonElement>("#previewDownloadBtn")?.addEventListener("click", async () => {
|
||||
async function bindDownloadModel(model: ModelItem) {
|
||||
try {
|
||||
await downloadFileFromUrl(model.file_url, model.original_filename || model.name);
|
||||
} catch (error) {
|
||||
notifyError(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resolveBasePoint(basePoint?: PreviewBasePoint): PreviewResolvedBasePoint {
|
||||
|
||||
Reference in New Issue
Block a user