Skip to content

Commit

Permalink
Merge pull request osTicket#468 from protich/feature/discard_warning
Browse files Browse the repository at this point in the history
Discard warning on ticket view page.
  • Loading branch information
protich committed Feb 18, 2013
2 parents d82c502 + 0eaa135 commit 26a4229
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
11 changes: 7 additions & 4 deletions scp/js/ticket.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ var autoLock = {
autoLock.renewLock(e);
}

if(!autoLock.lasteventTime) //I hate nav away warnings..but
autoLock.addEvent(window,'beforeunload',autoLock.discardWarning,true);

if(!autoLock.lasteventTime) { //I hate nav away warnings..but
$(window).bind('beforeunload', function(e) {
return "Any changes or info you've entered will be discarded!";
});
}

autoLock.lasteventTime=new Date().getTime();
},

Expand Down Expand Up @@ -126,7 +129,7 @@ var autoLock = {
onSubmit: function(e) {
if(e.type=='submit') { //Submit. double check!
//remove nav away warning if any.
autoLock.removeEvent(window,'beforeunload',autoLock.discardWarning,true);
$(window).unbind('beforeunload');
//Only warn if we had a failed lock attempt.
if(autoLock.warn && !autoLock.lockId && autoLock.lasteventTime) {
var answer=confirm('Unable to acquire a lock on the ticket. Someone else could be working on the same ticket. \
Expand Down
15 changes: 0 additions & 15 deletions scp/js/ticket.min.js

This file was deleted.

0 comments on commit 26a4229

Please sign in to comment.