mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-28 13:31:06 +00:00
Disable leave confirm when voting for map or server
This commit is contained in:
parent
3589e226d3
commit
450f821232
1 changed files with 9 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
<div id="jplayer"></div>
|
||||
<script type="text/javascript">
|
||||
var played = false;
|
||||
var leaving = false;
|
||||
var leave_confirm = true;
|
||||
<% if @gatherer and @gatherer.can_destroy? cuser %>
|
||||
var gatherer_id = <%= @gatherer.id %>;
|
||||
<% else %>
|
||||
|
@ -59,20 +59,23 @@
|
|||
});
|
||||
|
||||
$(window).bind('beforeunload', function(e) {
|
||||
if (gatherer_id > 0 && !leaving) {
|
||||
if (gatherer_id > 0 && leave_confirm) {
|
||||
return "You will be removed from the Gather if you leave this page.";
|
||||
}
|
||||
});
|
||||
|
||||
$(window).bind('unload', function() {
|
||||
if (gatherer_id > 0 && !leaving) {
|
||||
if (gatherer_id > 0 && leave_confirm) {
|
||||
updateGathererStatus('leaving');
|
||||
}
|
||||
});
|
||||
|
||||
$('.leave-gather').click(function() {
|
||||
leaving = true;
|
||||
});
|
||||
var disable_leave_confirm = function() {
|
||||
leave_confirm = false;
|
||||
}
|
||||
|
||||
$('.leave-gather').click(disable_leave_confirm);
|
||||
$('#gather-area a').click(disable_leave_confirm);
|
||||
|
||||
var afk = false;
|
||||
var afk_timeout;
|
||||
|
|
Loading…
Reference in a new issue