diff --git a/include/client/open.inc.php b/include/client/open.inc.php index afe0b261a6ca8d2b77d12b771e4a82ead6031f50..26b6d30edf9ab857dd1fb5b25f63bcfbc5a22c3e 100644 --- a/include/client/open.inc.php +++ b/include/client/open.inc.php @@ -94,7 +94,13 @@ if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) { <hr/> <p style="text-align:center;"> <input type="submit" value="Create Ticket"> - <input type="reset" value="Reset"> - <input type="button" value="Cancel" onClick='window.location.href="index.php"'> + <input type="reset" name="reset" value="Reset"> + <input type="button" name="cancel" value="Cancel" onclick="javascript: + $('.richtext').each(function() { + var redactor = $(this).data('redactor'); + if (redactor && redactor.opts.draftDelete) + redactor.deleteDraft(); + }); + window.location.href='index.php';"> </p> </form> diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php index dbf2180e3c7494cc9bb38d537cc7fa115e826c35..d14f7e98e393e6ed10d5a03c9ce5523e8fdbe6a8 100644 --- a/include/staff/ticket-open.inc.php +++ b/include/staff/ticket-open.inc.php @@ -373,10 +373,17 @@ if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) { </tr> </tbody> </table> -<p style="padding-left:250px;"> +<p style="text-align:center;"> <input type="submit" name="submit" value="Open"> <input type="reset" name="reset" value="Reset"> - <input type="button" name="cancel" value="Cancel" onclick='window.location.href="tickets.php"'> + <input type="button" name="cancel" value="Cancel" onclick="javascript: + $('.richtext').each(function() { + var redactor = $(this).data('redactor'); + if (redactor && redactor.opts.draftDelete) + redactor.deleteDraft(); + }); + window.location.href='tickets.php'; + "> </p> </form> <script type="text/javascript">