fix rich editor embed image original

This commit is contained in:
2024-09-13 18:11:57 +03:00
parent c0b3878674
commit c45a3847f8
5 changed files with 6 additions and 7 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"main.js": {
"file": "assets/main-BC8xx0YD.js",
"file": "assets/main-BLsQ9H2G.js",
"name": "main",
"src": "main.js",
"isEntry": true,
@@ -16,7 +16,6 @@
export let editable = true;
export function insertMedia(info) {
let insertText = "";
if (info.record._file.width > 0) {
insertText = `![${info.record._file.originalName}](${info.url})`;
@@ -1,6 +1,4 @@
<script>
import {sortByField} from "../../edges/sortEdges";
import Sortable from "../../libs/Sortable.svelte";
import PreviewFile from "../previews/PreviewFile.svelte";
import Dropdown from "../../common/Dropdown.svelte";
import Dialog from "../../dialog/Dialog.svelte";
@@ -70,7 +68,8 @@
{#each references as reference (reference.id)}
<!--This div helps the sorting thing-->
<div>
<PreviewFile record={reference} hasDelete={true} hasInsert={true} on:remove={removeReference} on:editor-insert></PreviewFile>
<PreviewFile record={reference} hasDelete={true} hasInsert={true} on:remove={removeReference}
on:editor-insert></PreviewFile>
</div>
{/each}
{/if}
@@ -26,9 +26,10 @@
function insert(e, preset) {
e.preventDefault();
let html = htmlurl(channel, record, preset)
let url = !preset ? `/${record._file.path}` : `/templates/${preset}/${record._file.path}`;
dispatch("editor-insert", {
html: html,
url: channel.filesUrl + `/templates/${preset}/${record._file.path}`,
url: channel.filesUrl + url,
originalUrl: channel.filesUrl + "/" + record._file.path,
record: record
});