]> _ Git - fluidbook_tools.git/commitdiff
wait #7553 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 May 2025 17:48:03 +0000 (19:48 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 May 2025 17:48:03 +0000 (19:48 +0200)
src/Links/Link.php

index 9cb9fab3d6604d6be58be893b5a390723829e2a2..95ab87413cb7609bc0de0587dd4a597ddcfd6dbc 100644 (file)
@@ -721,6 +721,9 @@ class Link
         if ($this->stats) {
             $res .= 'data-stats="' . htmlspecialchars(json_encode($this->stats), ENT_QUOTES) . '" ';
         }
+        if ($this->isOutsidePage()) {
+            $res .= ' data-outside-page="1" tabindex="-1"';
+        }
 
         return $res;
 
@@ -883,7 +886,7 @@ class Link
 
     public function isOutsidePage()
     {
-        return $this->top > $this->compiler->getHeightForLinks($this->page) || $this->left > $this->compiler->getWidthForLinks($this->page);
+        return $this->top + $this->height <= 0 || $this->top > $this->compiler->getHeightForLinks($this->page) || $this->left > $this->compiler->getWidthForLinks($this->page) || $this->left + $this->width <= 0;;
     }
 
     public function ignore()