wzl 1 mese fa
parent
commit
ae0a421b93

+ 1 - 1
packages/core/src/annotation/freetext.js

@@ -592,7 +592,7 @@ export default class Shape extends Base {
 
   handleContainerClick (event) {
     event && event.stopPropagation()
-    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     this.hidden = false
     this.updateTool()
     onClickOutside([this.outerLine, this.freetextElement, this.deletetButton, this.replyButton, document.querySelector('.toggle-button')], this.handleOutside.bind(this))

+ 1 - 1
packages/core/src/annotation/ink.js

@@ -126,7 +126,7 @@ export default class Ink extends Base {
     if (this.layer.tool) {
       event && event.stopPropagation()
     }
-    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     this.hidden = false
     this.updateTool()
     onClickOutside([this.svgElement, this.outerLine, this.deletetButton, this.replyButton, document.querySelector('.toggle-button')], this.handleOutside.bind(this))

+ 2 - 2
packages/core/src/annotation/line.js

@@ -244,8 +244,8 @@ export default class Line extends Base {
     this.handleClick()
   }
 
-  handleClick () {
-    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+  handleClick (event) {
+    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     this.hidden = false
     this.updateTool()
     onClickOutside([this.svgElement, this.outerLine, this.deletetButton, this.replyButton, document.querySelector('.toggle-button')], this.handleOutside.bind(this))

+ 2 - 2
packages/core/src/annotation/link.js

@@ -425,8 +425,8 @@ export default class Link extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target) || this.layer.toolMode === 'editor') return
+  handleClick (event) {
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target) || this.layer.toolMode === 'editor') return
     if (this.layer.toolMode === 'annotation' && this.layer.tool === 'link') {
       this.hidden = false
       this.updateTool()

+ 2 - 2
packages/core/src/annotation/shape.js

@@ -421,8 +421,8 @@ export default class Shape extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+  handleClick (event) {
+    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     this.hidden = false
     this.updateTool()
     onClickOutside([this.svgElement, this.outerLine, this.deletetButton, this.replyButton, document.querySelector('.toggle-button')], this.handleOutside.bind(this))

+ 1 - 1
packages/core/src/annotation/stamp.js

@@ -398,7 +398,7 @@ export default class Stamp extends Base {
     if (this.layer.tool) {
       event && event.preventDefault()
     }
-    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+    if (!this.hidden || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     this.hidden = false
     this.updateTool()
     onClickOutside([this.annotationContainer, this.outerLine, this.deletetButton, this.replyButton, document.querySelector('.toggle-button')], this.handleOutside.bind(this))

+ 1 - 1
packages/core/src/annotation/text.js

@@ -306,7 +306,7 @@ export default class Text extends Base {
   }
 
   handleClick (event) {
-    if (this.layer.addMode || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+    if (this.layer.addMode || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     if (this.layer.tool) {
       event && event.stopPropagation()
     }

+ 2 - 2
packages/core/src/form/check_box.js

@@ -502,8 +502,8 @@ export default class CheckBox extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+  handleClick (event) {
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     if (this.layer.toolMode === 'form') {
       this.hidden = false
       this.updateTool()

+ 2 - 2
packages/core/src/form/combo_box.js

@@ -512,8 +512,8 @@ export default class ComboBox extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+  handleClick (event) {
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     if (this.layer.toolMode === 'form') {
       this.hidden = false
       this.updateTool()

+ 1 - 1
packages/core/src/form/list_box.js

@@ -478,7 +478,7 @@ export default class ListBox extends Base {
   }
 
   handleClick(event) {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     if (this.layer.toolMode === 'form') {
       this.hidden = false
       this.updateTool()

+ 2 - 2
packages/core/src/form/push_button.js

@@ -455,8 +455,8 @@ export default class PushButton extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+  handleClick (event) {
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     if (this.layer.toolMode === 'form') {
       this.hidden = false
       this.updateTool()

+ 2 - 2
packages/core/src/form/radio_button.js

@@ -503,8 +503,8 @@ export default class RadioButton extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+  handleClick (event) {
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     if (this.layer.toolMode === 'form') {
       this.hidden = false
       this.updateTool()

+ 2 - 2
packages/core/src/form/signature_fields.js

@@ -383,8 +383,8 @@ export default class SignatureFields extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target) || this.layer.toolMode === 'editor' || document.getElementById("sign-image-save")) return
+  handleClick (event) {
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target) || this.layer.toolMode === 'editor' || document.getElementById("sign-image-save")) return
     if (this.isDigital) return
     if (this.layer.pageDiv.querySelector('.annotationLayer svg').style.cursor === 'crosshair' && this.layer.toolMode !== 'sign') return
 

+ 2 - 2
packages/core/src/form/text_field.js

@@ -436,8 +436,8 @@ export default class TextField extends Base {
     }
   }
 
-  handleClick () {
-    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+  handleClick (event) {
+    if (!this.hidden || document.fullscreenElement || this.layer.annotationStore.creating || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     if (this.layer.toolMode === 'form') {
       this.hidden = false
       this.updateTool()

+ 1 - 1
packages/core/src/markup/text_annotation.js

@@ -204,7 +204,7 @@ class TextAnnotation extends BaseAnnotation {
   }
 
   handleClick (event) {
-    if (!this.hidden || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event.target)) return
+    if (!this.hidden || ['redaction', 'remove'].includes(this.layer.tool) || document.querySelector('.compare-document-container').contains(event?.target)) return
     this.hidden = false
     this.updateTool()
     const data = [this.markupContainer, this.outerLineContainer, this.deletetButton, this.replyButton]