diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js index 2efba9ebcbb1956ecfe0369b517b15740ebf943b..5184d3344d1a53f5269c4f2588de4af31d3db905 100644 --- a/js/redactor-osticket.js +++ b/js/redactor-osticket.js @@ -64,6 +64,11 @@ RedactorPlugins.draft = { setupDraftUpdate: function(data) { this.$box.parent().find('.draft-saved').show(); + // Slight workaround. Signal the 'keyup' event normally signaled + // from typing in the <textarea> + if ($.autoLock && this.opts.draft_namespace == 'ticket.response') + $.autoLock.handleEvent(); + if (typeof data != 'object') data = $.parseJSON(data); diff --git a/scp/js/ticket.js b/scp/js/ticket.js index fb9f7370ed84ce178bdc0f233ef2ab16c066d7a4..84f7e287f64b935e1c676b3873009506dc24ba03 100644 --- a/scp/js/ticket.js +++ b/scp/js/ticket.js @@ -200,6 +200,7 @@ var autoLock = { type: 'POST', url: 'ajax.php/tickets/'+autoLock.tid+'/lock/'+autoLock.lockId+'/release', data: 'delete', + async: false, cache: false, success: function(){ @@ -257,7 +258,8 @@ var autoLock = { clearTimeout(autoLock.timerId); autoLock.timerId=setTimeout(function () { autoLock.monitorEvents() },30000); } -} +}; +$.autoLock = autoLock; /* UI & form events