Commit 9ff33b3d authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge "Make sure TinyMCE shows up on Feedback forms after failure to submit"

parents a31485d6 267f6bc2
......@@ -737,6 +737,7 @@ class ArtefactTypeComment extends ArtefactType {
'autofocus' => false,
'elements' => array(),
'jssuccesscallback' => 'addFeedbackSuccess',
'jserrorcallback' => 'addFeedbackError',
);
if (!$USER->is_logged_in()) {
$form['spam'] = array(
......
......@@ -8,6 +8,19 @@
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
/*
* This called when data of submitted feedback form are invalid
* This shows the tinymce editor and error message
*/
function addFeedbackError(form, data) {
if (isTinyMceUsed()) {
var mce = tinyMCE.get('add_feedback_form_message');
mce.show();
jQuery('.mce-toolbar.mce-first').siblings().toggleClass('hidden');
mce.focus();
}
formError(form, data);
}
function addFeedbackSuccess(form, data) {
addElementClass('add_feedback_form', 'hidden');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment