[Rt-commit] rt branch 6.0/htmx updated. rt-5.0.4-29-g4c20e698b7
BPS Git Server
git at git.bestpractical.com
Wed Jan 10 22:22:08 UTC 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 6.0/htmx has been updated
via 4c20e698b71f4a416ce50b7545cbb66212d5f473 (commit)
from 4326958f9ba97869bbeb2d1867b53e4cdacb831f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4c20e698b71f4a416ce50b7545cbb66212d5f473
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Jan 10 17:10:21 2024 -0500
Update richtext values before htmx submits data
CKEditor automatically updates corresponding textarea values on form submit,
but htmx collects data before that, which causes submitted textarea values
to be outdated.
This commit explicitly updates textarea values before htmx submits, to get
around the issue.
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 79954ba8f9..78d410ea99 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -992,6 +992,14 @@ document.addEventListener("htmx:load", function() {
);
return false;
});
+
+ document.body.addEventListener('htmx:configRequest', function(evt) {
+ for ( const param in evt.detail.parameters ) {
+ if ( evt.detail.parameters[param + 'Type'] === 'text/html' && CKEDITOR.instances[param] ) {
+ evt.detail.parameters[param] = CKEDITOR.instances[param].getData();
+ }
+ }
+ });
});
function filterSearchResults () {
-----------------------------------------------------------------------
Summary of changes:
share/static/js/util.js | 8 ++++++++
1 file changed, 8 insertions(+)
hooks/post-receive
--
rt
More information about the rt-commit
mailing list