Browse Source

enhance: use a button for copy all

Tienson Qin 4 years ago
parent
commit
71000a4e4d
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/main/frontend/extensions/pdf/highlights.cljs

+ 6 - 6
src/main/frontend/extensions/pdf/highlights.cljs

@@ -14,7 +14,8 @@
             [frontend.components.svg :as svg]
             [medley.core :as medley]
             [frontend.fs :as fs]
-            [clojure.string :as string]))
+            [clojure.string :as string]
+            [frontend.ui :as ui]))
 
 (defn dd [& args]
   (apply js/console.debug args))
@@ -735,15 +736,14 @@
       [:p {:key k} [:strong k] "  " [:i (pr-str v)]])]
 
    [:div.flex.items-center.justify-center.pt-2.pb--2
-    [:a.button.p-2
-     {:on-click
+    (ui/button "Copy all"
+      :on-click
       (fn []
         (let [text (.-innerText (js/document.querySelector "#pdf-docinfo > .inner-text"))
               text (string/replace-all text #"[\n\t]+" "\n")]
           (front-utils/copy-to-clipboard! text)
           (notification/show! "Copied!" :success)
-          (close-fn!)))}
-     "Copy all properties"]]])
+          (close-fn!))))]])
 
 (defn make-docinfo-in-modal
   [info]
@@ -1026,4 +1026,4 @@
      (when pdf-current
        (js/ReactDOM.createPortal
          (pdf-container pdf-current)
-         (js/document.querySelector "#app-single-container")))]))
+         (js/document.querySelector "#app-single-container")))]))