Ver Fonte

fix(pdf): go to highlight

charlie há 4 anos atrás
pai
commit
45b5554acf

+ 1 - 2
src/main/frontend/extensions/pdf/highlights.cljs

@@ -532,8 +532,7 @@
      {:class (front-utils/classnames [{:has-children has-child? :is-expand expanded?}])}
      [:div.inner
       [:a
-       {:href      "javascript:void(0);"
-        :data-dest (js/JSON.stringify (bean/->js dest))
+       {:data-dest (js/JSON.stringify (bean/->js dest))
         :on-click  (fn [^js/MouseEvent e]
                      (let [target (.-target e)]
                        (if (.closest target "i")

+ 1 - 1
src/main/frontend/extensions/pdf/utils.cljs

@@ -8,7 +8,7 @@
 
 (defonce MAX-SCALE 5.0)
 (defonce MIN-SCALE 0.25)
-(defonce DELTA_SCALE 1.1)
+(defonce DELTA_SCALE 1.05)
 
 (defn get-bounding-rect
   [rects]

+ 2 - 1
src/main/frontend/extensions/pdf/utils.js

@@ -105,6 +105,7 @@ export const scrollToHighlight = (viewer, highlight) => {
       null, { name: 'XYZ' },
       ...viewport.convertToPdfPoint(0, scaledToViewport(bounding, viewport).top - 200),
       0 // scale
-    ]
+    ],
+    ignoreDestinationZoom: true
   })
 }