marsadh commited on
Commit
6ddb8ef
·
verified ·
1 Parent(s): 7125344

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +19 -7
index.html CHANGED
@@ -59,6 +59,7 @@
59
  #questionInput {
60
  text-align: left !important;
61
  }
 
62
  </style>
63
  </head>
64
  <body class="min-h-screen bg-white text-gray-900 font-inter-tight antialiased">
@@ -217,13 +218,24 @@
217
  this.elements.analyzeBtn.addEventListener('click', () => this.analyzeImage());
218
 
219
  // Quick question buttons
220
- document.querySelectorAll('.quick-question').forEach(btn => {
221
- btn.addEventListener('click', (e) => {
222
- this.elements.questionInput.value = e.target.textContent;
223
- this.updateAnalyzeButton();
224
- });
225
- });
226
- }
 
 
 
 
 
 
 
 
 
 
 
227
 
228
  handleDragOver(e) {
229
  e.preventDefault();
 
59
  #questionInput {
60
  text-align: left !important;
61
  }
62
+
63
  </style>
64
  </head>
65
  <body class="min-h-screen bg-white text-gray-900 font-inter-tight antialiased">
 
218
  this.elements.analyzeBtn.addEventListener('click', () => this.analyzeImage());
219
 
220
  // Quick question buttons
221
+ document.querySelectorAll('.quick-question').forEach(btn => {
222
+ btn.addEventListener('click', (e) => {
223
+ // Set the value
224
+ this.elements.questionInput.value = e.target.textContent;
225
+ // Explicitly dispatch an 'input' event
226
+ // This helps ensure styles (like text-align) are correctly applied
227
+ // and other event listeners (like updateAnalyzeButton) are triggered.
228
+ const inputEvent = new Event('input', {
229
+ bubbles: true,
230
+ cancelable: true,
231
+ });
232
+ this.elements.questionInput.dispatchEvent(inputEvent);
233
+ // Optional: You can remove the direct call to updateAnalyzeButton now
234
+ // as the dispatched event should trigger it, but calling it explicitly
235
+ // is also fine and ensures it runs.
236
+ // this.updateAnalyzeButton(); // Can be removed if the event listener handles it
237
+ });
238
+ });
239
 
240
  handleDragOver(e) {
241
  e.preventDefault();