Sfoglia il codice sorgente

fix(ui): pdf asset ref link for the file based graph

charlie 1 anno fa
parent
commit
13e86f0dda
1 ha cambiato i file con 3 aggiunte e 10 eliminazioni
  1. 3 10
      src/main/frontend/components/block.cljs

+ 3 - 10
src/main/frontend/components/block.cljs

@@ -480,7 +480,9 @@
 
           (= ext :pdf)
           [:a.asset-ref.is-pdf
-           {:href @src
+           {:data-href href
+            :draggable true
+            :on-drag-start #(.setData (gobj/get % "dataTransfer") "file" href)
             :on-click (fn [e]
                         (util/stop e)
                         (open-pdf-file e (:asset-block config) @src))}
@@ -1280,15 +1282,6 @@
       (contains? config/audio-formats ext)
       (audio-link config url s label metadata full_text)
 
-      (= ext :pdf)
-      [:a.asset-ref.is-pdf
-       {:data-href s
-        :on-click (fn [^js e] (open-pdf-file e (:asset-block config) nil))
-        :draggable true
-        :on-drag-start #(.setData (gobj/get % "dataTransfer") "file" s)}
-       (or label-text
-           (->elem :span (map-inline config label)))]
-
       (contains? config/doc-formats ext)
       (asset-link config label-text s metadata full_text)