| @@ -336,8 +336,9 @@ | ||
| 336 | 336 | // Initialize all toggle visibility buttons |
| 337 | 337 | [ |
| 338 | 338 | '#toggleApiKeyVisibility', |
| 339 | 339 | '#toggleWooCommerceSecretVisibility', |
| 340 | + '#toggleVoyageAPIKeyVisibility', | |
| 340 | 341 | '#toggleLoopsApiKeyVisibility', |
| 341 | 342 | '#toggleXaiApiKeyVisibility', |
| 342 | 343 | '#toggleClaudeApiKeyVisibility', |
| 343 | 344 | '#toggleBraveApiKeyVisibility', |
| @@ -543,8 +544,26 @@ | ||
| 543 | 544 | window.mxchatSaveSetting('live_agent_status', this.checked ? 'on' : 'off'); |
| 544 | 545 | } |
| 545 | 546 | }); |
| 546 | 547 | } |
| 548 | + | |
| 549 | + // Function to adjust the textarea height to content | |
| 550 | + function adjustTextareaHeight() { | |
| 551 | + this.style.height = 'auto'; // Reset to auto to calculate scrollHeight | |
| 552 | + this.style.height = this.scrollHeight + 'px'; // Expand to content height | |
| 553 | + } | |
| 554 | + | |
| 555 | + // Function to reset the textarea height to initial | |
| 556 | + function resetTextareaHeight() { | |
| 557 | + this.style.height = ''; // Remove inline height, reverting to CSS default | |
| 558 | + } | |
| 559 | + | |
| 560 | + // Target the specific textarea by ID | |
| 561 | + var $textarea = $('#system_prompt_instructions'); | |
| 562 | + | |
| 563 | + // Bind events | |
| 564 | + $textarea.on('focus input', adjustTextareaHeight) // Expand on focus and input | |
| 565 | + .on('blur', resetTextareaHeight); // Reset on blur | |
| 547 | 566 | |
| 548 | 567 | |
| 549 | 568 | }); |
| 550 | 569 | |