Skip to content

Commit

Permalink
SAK-50792 Discussions: insert original text fails (sakaiproject#13142)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonespm authored Dec 28, 2024
1 parent 8ee961a commit 83ef061
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions msgcntr/messageforums-app/src/webapp/jsp/dfMessageReply.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@
<sakai:inputRichText textareaOnly="#{PrivateMessagesTool.mobileSession}" value="#{ForumTool.composeBody}" id="df_compose_body" rows="#{ForumTool.editorRows}" cols="132">
</sakai:inputRichText>
<script>
// set the previous message variable
var textareas = document.getElementsByTagName("textarea");
var rteId = textareas.item(1).id;
// Give it a chance to try to detect the name incase it might change
const textarea = document.currentScript.previousElementSibling?.querySelector('textarea'); // Select the first <textarea> in the previous sibling
// Set the value found else default to the one we last used. This value is used in forum.js
const rteId = textarea ? textarea.id : "dfCompose:df_compose_body_inputRichText";
var messagetext = document.forms['dfCompose'].elements['dfCompose:msgHidden'].value;
var titletext = document.forms['dfCompose'].elements['dfCompose:titleHidden'].value;
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@
CKEDITOR.on('instanceReady', function() {resizeFrame('grow')});
</script --%>
<script>
var textareas = document.getElementsByTagName("textarea");
var rteId = textareas.item(1).id;
// set the previous message variable
// Give it a chance to try to detect the name incase it might change
const textarea = document.currentScript.previousElementSibling?.querySelector('textarea'); // Select the first <textarea> in the previous sibling
// Set the value found else default to the one we last used. This value is used in forum.js
const rteId = textarea ? textarea.id : "dfCompose:df_compose_body_inputRichText";
var messagetext = document.forms['dfCompose'].elements['dfCompose:msgHidden'].value;
var titletext = document.forms['dfCompose'].elements['dfCompose:titleHidden'].value;
</script>
Expand Down

0 comments on commit 83ef061

Please sign in to comment.