Hi,
I have a link that opens a dialog using the following code
{include file="common/popupbox.tpl" id="edit-kb-question-{$content_question->question_id}" act="edit" opener_ajax_class="cm-ajax-force" link_text=$content_question->question href="bfa_knowledgebase.edit.question&question_id={$content_question->question_id}&kb_content_id={$kb_content->kb_content_id}"} </td>
Clicking on the link opens a dialog with a WYSIWYG editor, defined by the following:
<form action="{""|fn_url}" method="post" enctype="multipart/form-data" class="form-horizontal form-edit cm-ajax cm-form-dialog-closer cm-ajax-force" enctype="multipart/form-data"> <input type="hidden" name="question[kb_content_id]" value="{$smarty.get.kb_content_id}"> <input type="hidden" name="question[question_id]" value="{$question->question_id}"> <input type="hidden" name="result_ids" value="content_questions" /> <fieldset> <div class="control-group"> <label class="control-label" for="question">Question</label> <div class="controls"> <input class="span9" type="text" name="question[question]" value="{$question->question}" id="question" placeholder="E.g. My fridge is not getting cold"> </div> </div> <div class="control-group"> <label class="control-label" for="answer">Answer</label> <div class="controls"> <textarea id="answer" name="question[answer]" cols="55" rows="2" class="cm-wysiwyg input-large">{$question->answer}</textarea> </div> </div> </fieldset> <div class="buttons-container"> {include file="buttons/save_changes.tpl" but_name="dispatch[`$dispatch`]" cancel_action="close" save=true} </div> </form>
Which all works fine. Until I close the dialog and reopen it. When I click on the link and launch the dialog again and the WYSIWYG editor is duplicated. I have had a look at the js/tygh/core.js file and I can see that destory is called before the dialog is closed, but it still duplicates.
Anyone experience this or have any thoughts?
Thanks...