Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions agentic_security/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,26 @@ var app = new Vue({
},
focusTextarea() {
this.isFocused = true;
self = this.$refs;
// Remove 'self' assignment if not used elsewhere
this.$nextTick(() => {
// Focus the textarea after rendering
self.textarea.focus();
this.adjustHeight({ target: self.textarea });
this.$refs.textarea.focus();
this.adjustHeight({ target: this.$refs.textarea });
});
document.addEventListener("mousedown", this.handleClickOutside);

// Correct the event listener to use handleOutsideClick
document.addEventListener("mousedown", this.handleOutsideClick);
},
handleOutsideClick(event) {
if (!this.$refs.container.contains(event.target)) {
if (!this.$refs.textarea.contains(event.target)) {
this.isFocused = false;
document.removeEventListener("mousedown", this.handleClickOutside);
document.removeEventListener("mousedown", this.handleOutsideClick);
}
},
unfocusTextarea() {
this.isFocused = false;
},
acceptConsent() {
this.showConsentModal = false; // Close the modal

try {
localStorage.setItem('consentGiven', 'true'); // Save consent to local storage
} catch (e) {
Expand Down Expand Up @@ -215,7 +214,7 @@ var app = new Vue({
spec: this.modelSpec,
};
let startTime = performance.now(); // Capture start time

try {
const response = await fetch(`${SELF_URL}/verify`, {
method: 'POST',
Expand All @@ -224,7 +223,7 @@ var app = new Vue({
},
body: JSON.stringify(payload),
});

let r = await response.json();

let endTime = performance.now(); // Capture end time
Expand Down