Don't add on click events on dialog open
Instead add them once durring setup This fixes an issue where click events would fire x amount of times depending on how many times the dialog was opened and closed, on even times sort would run twice and not toggle.
This commit is contained in:
@ -287,11 +287,6 @@ window.plugin.scoreboard.display = function() {
|
||||
id: 'scoreboard'
|
||||
});
|
||||
|
||||
// Setup sorting
|
||||
$(document).on('click', '#players table th', function() {
|
||||
$('#players').html(window.plugin.scoreboard.playerTable($(this).data('sort')));
|
||||
});
|
||||
|
||||
//run the name resolving process
|
||||
resolvePlayerNames();
|
||||
}
|
||||
@ -334,6 +329,10 @@ var setup = function() {
|
||||
'.mu_score span.res { background-color: #005684; text-align: right; padding-right:4px; }' +
|
||||
'.mu_score span.enl { background-color: #017f01; padding-left: 4px; }' +
|
||||
'</style>');
|
||||
// Setup sorting
|
||||
$(document).on('click', '#players table th', function() {
|
||||
$('#players').html(window.plugin.scoreboard.playerTable($(this).data('sort')));
|
||||
});
|
||||
}
|
||||
|
||||
// PLUGIN END //////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user