drakosfire commited on
Commit
e1d03aa
1 Parent(s): 3a05b59

moved initializeTextareaResizing into the extracBlocks function to ensure it fires after the extract at page load

Browse files
Files changed (1) hide show
  1. scripts.js +7 -4
scripts.js CHANGED
@@ -66,7 +66,7 @@ document.addEventListener("DOMContentLoaded", function() {
66
  // document.getElementById('add-page-button').addEventListener('click', addPage);
67
  // document.getElementById('remove-page-button').addEventListener('click', removePage);
68
 
69
- fetch('http://127.0.0.1:5000/process-description', {
70
  method: 'POST',
71
  headers: {
72
  'Content-Type': 'application/json'
@@ -283,8 +283,11 @@ document.addEventListener("DOMContentLoaded", function() {
283
  ];
284
 
285
  classes.forEach(className => {
 
 
286
  const textareas = document.querySelectorAll(`.${className}`);
287
- textareas.forEach(textarea => {
 
288
 
289
  // Adjust height on page load
290
  adjustTextareaHeight(textarea);
@@ -297,8 +300,7 @@ document.addEventListener("DOMContentLoaded", function() {
297
  });
298
  }
299
 
300
- // Initial run on page load
301
- initializeTextareaResizing();
302
 
303
  async function extractBlocks() {
304
  try {
@@ -350,6 +352,7 @@ document.addEventListener("DOMContentLoaded", function() {
350
  } catch (error) {
351
  console.error('Error fetching and parsing template_update.html:', error);
352
  }
 
353
  }
354
 
355
 
 
66
  // document.getElementById('add-page-button').addEventListener('click', addPage);
67
  // document.getElementById('remove-page-button').addEventListener('click', removePage);
68
 
69
+ fetch('/process-description', {
70
  method: 'POST',
71
  headers: {
72
  'Content-Type': 'application/json'
 
283
  ];
284
 
285
  classes.forEach(className => {
286
+ console.log('Initializing textareas for class:', className);
287
+ console.log(document.querySelectorAll(`.${className}`));
288
  const textareas = document.querySelectorAll(`.${className}`);
289
+ textareas.forEach(textarea => {
290
+ console.log('Textarea found:', textarea);
291
 
292
  // Adjust height on page load
293
  adjustTextareaHeight(textarea);
 
300
  });
301
  }
302
 
303
+
 
304
 
305
  async function extractBlocks() {
306
  try {
 
352
  } catch (error) {
353
  console.error('Error fetching and parsing template_update.html:', error);
354
  }
355
+ initializeTextareaResizing();
356
  }
357
 
358