Commit 09ef3aad authored by Lisa Seeto's avatar Lisa Seeto
Browse files

Bug 1212095: The content of text boxes should be reset when clicking 'cancel' button



set content back to original content on cancellation via tinyMCE

behatnotneeded

Change-Id: I58c25cac88b437cb9eded3a9849ddef9bb0f5b9f
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent 819106ab
......@@ -27,7 +27,7 @@ jQuery(function($) {
if (typeof tinyMCE != 'undefined') {
var editor = tinyMCE.get(t),
formTop = container.closest('#main-column-container').attr('id');;
formTop = container.closest('#main-column-container').attr('id');
$('.mce-toolbar.mce-first').siblings().toggleClass('d-none');
editor.show();
editor.focus();
......@@ -59,7 +59,10 @@ jQuery(function($) {
displaycontainer.removeClass("d-none");
editcontainer.removeClass("d-none");
if (typeof tinyMCE != 'undefined') {
tinyMCE.get(t).hide();
// Clear any cancelled content back to original
var ed = tinyMCE.get(t);
ed.setContent($('#' + t).text());
ed.hide();
}
else {
$("#" + t).addClass("js-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