diff --git a/include/client/open.inc.php b/include/client/open.inc.php index ea0a100e7f67eeab48c0d1e61df43e14eda47f28..80cc3456b0eb73ad1368b5557104ed1b48caf840 100644 --- a/include/client/open.inc.php +++ b/include/client/open.inc.php @@ -116,7 +116,7 @@ if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) { $('.richtext').each(function() { var redactor = $(this).data('redactor'); if (redactor && redactor.opts.draftDelete) - redactor.deleteDraft(); + redactor.draft.deleteDraft(); }); window.location.href='index.php';"> </p> diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php index 6041f5573480b67ee10c94d26a52e81050aed2f8..8eda359add4b0118f18e500f39ce7220f0f71e9a 100644 --- a/include/staff/ticket-open.inc.php +++ b/include/staff/ticket-open.inc.php @@ -385,13 +385,9 @@ print $response_form->getField('attachments')->render(); <input type="submit" name="submit" value="<?php echo _P('action-button', 'Open');?>"> <input type="reset" name="reset" value="<?php echo __('Reset');?>"> <input type="button" name="cancel" value="<?php echo __('Cancel');?>" onclick="javascript: - $('.richtext').each(function() { - var redactor = $(this).data('redactor'); - if (redactor && redactor.opts.draftDelete) - redactor.deleteDraft(); - }); - window.location.href='tickets.php'; - "> + $(this.form).find('textarea.richtext') + .redactor('draft.deleteDraft'); + window.location.href='tickets.php'; " /> </p> </form> <script type="text/javascript">