fix: sometimes pdf links can't be opened

pull/2575/head
Tienson Qin 2021-08-06 21:28:02 +08:00
parent de7c6584fb
commit 5987fbcddd
2 changed files with 5 additions and 5 deletions

View File

@ -456,10 +456,10 @@
(string/ends-with? (util/node-path.dirname full-path) config/local-assets-dir))
[:a.asset-ref.is-pdf
{:href "javascript:void(0);"
:on-click (fn [e]
:on-mouse-down (fn [e]
(when-let [current (pdf-assets/inflate-asset (util/node-path.basename full-path))]
(state/set-state! :pdf/current current)
(.preventDefault e)))}
(util/stop e)
(state/set-state! :pdf/current current)))}
title-or-path]
[:a.asset-ref {:target "_blank" :href full-path}
title-or-path])

View File

@ -504,13 +504,13 @@
&.is-pdf {
&:before {
content: "[[📚";
opacity: .4;
opacity: .7;
margin-right: 4px;
}
&:after {
content: "]]";
opacity: .4;
opacity: .7;
}
}
}