mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-08-08 10:48:37 +02:00
Fix: Update handleOutsideClick to use textarea ref (#175)
This commit is contained in:
@@ -110,19 +110,18 @@ var app = new Vue({
|
|||||||
},
|
},
|
||||||
focusTextarea() {
|
focusTextarea() {
|
||||||
this.isFocused = true;
|
this.isFocused = true;
|
||||||
self = this.$refs;
|
// Remove 'self' assignment if not used elsewhere
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// Focus the textarea after rendering
|
this.$refs.textarea.focus();
|
||||||
self.textarea.focus();
|
this.adjustHeight({ target: this.$refs.textarea });
|
||||||
this.adjustHeight({ target: self.textarea });
|
|
||||||
});
|
});
|
||||||
document.addEventListener("mousedown", this.handleClickOutside);
|
// Correct the event listener to use handleOutsideClick
|
||||||
|
document.addEventListener("mousedown", this.handleOutsideClick);
|
||||||
},
|
},
|
||||||
handleOutsideClick(event) {
|
handleOutsideClick(event) {
|
||||||
if (!this.$refs.container.contains(event.target)) {
|
if (!this.$refs.textarea.contains(event.target)) {
|
||||||
this.isFocused = false;
|
this.isFocused = false;
|
||||||
document.removeEventListener("mousedown", this.handleClickOutside);
|
document.removeEventListener("mousedown", this.handleOutsideClick);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
unfocusTextarea() {
|
unfocusTextarea() {
|
||||||
@@ -130,7 +129,7 @@ var app = new Vue({
|
|||||||
},
|
},
|
||||||
acceptConsent() {
|
acceptConsent() {
|
||||||
this.showConsentModal = false; // Close the modal
|
this.showConsentModal = false; // Close the modal
|
||||||
|
|
||||||
try {
|
try {
|
||||||
localStorage.setItem('consentGiven', 'true'); // Save consent to local storage
|
localStorage.setItem('consentGiven', 'true'); // Save consent to local storage
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -215,7 +214,7 @@ var app = new Vue({
|
|||||||
spec: this.modelSpec,
|
spec: this.modelSpec,
|
||||||
};
|
};
|
||||||
let startTime = performance.now(); // Capture start time
|
let startTime = performance.now(); // Capture start time
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${SELF_URL}/verify`, {
|
const response = await fetch(`${SELF_URL}/verify`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -224,7 +223,7 @@ var app = new Vue({
|
|||||||
},
|
},
|
||||||
body: JSON.stringify(payload),
|
body: JSON.stringify(payload),
|
||||||
});
|
});
|
||||||
|
|
||||||
let r = await response.json();
|
let r = await response.json();
|
||||||
|
|
||||||
let endTime = performance.now(); // Capture end time
|
let endTime = performance.now(); // Capture end time
|
||||||
|
|||||||
Reference in New Issue
Block a user