Commit 267f6bc2 authored by Son Nguyen's avatar Son Nguyen Committed by Aaron Wells

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

Bug 1450705: The normal Wysiwyg Pieform element's "onload()" can't
handle the TinyMCE in the feedback area, because of the additional
Feedback logic for hiding & showing the Feedback form.

Change-Id: Ic2c7ad8c2ce8720ba1fcaf19c3ec71b6529b4ff0
parent 6df28ecf
......@@ -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