Skip to content

Commit 400eca8

Browse files
author
Fran
committed
add Apply and Close button
1 parent 1e2db61 commit 400eca8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

simplehtmleditor.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,8 +1533,9 @@ if (!("ncsedtRestorableObj" in window)) {
15331533
' <label>AI Response:</label>' +
15341534
' <textarea id="ncsedt-dialog-agent-response" class="response sbutton" placeholder="AI response will appear here..." readonly></textarea>' +
15351535
' <div class="ai-actions">' +
1536-
' <button type="button" class="sbutton apply-response">Apply Changes</button>' +
15371536
' <button type="button" class="sbutton copy-response">Copy</button>' +
1537+
' <button type="button" class="sbutton apply-response">Apply Changes</button>' +
1538+
' <button type="button" class="sbutton apply-and-close">Apply and Close</button>' +
15381539
' </div>' +
15391540
' </div>' +
15401541
' </div>' +
@@ -1638,6 +1639,12 @@ if (!("ncsedtRestorableObj" in window)) {
16381639
document.querySelector('#ncsedt-dialog-agent .code').value = response;
16391640
});
16401641

1642+
document.querySelector("#ncsedt-dialog-agent .apply-and-close").addEventListener('click', function () {
1643+
var response = document.getElementById('ncsedt-dialog-agent-response').value;
1644+
document.querySelector('#ncsedt-dialog-agent .code').value = response;
1645+
_this.editAgentConfirm();
1646+
});
1647+
16411648
document.querySelector("#ncsedt-dialog-agent .copy-response").addEventListener('click', function () {
16421649
var responseTextarea = document.getElementById('ncsedt-dialog-agent-response');
16431650
responseTextarea.select();
@@ -1649,6 +1656,7 @@ if (!("ncsedtRestorableObj" in window)) {
16491656
}
16501657
});
16511658
};
1659+
16521660
/**
16531661
* Opens and initializes the AI agent dialog
16541662
*/

simplehtmleditor.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)