Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- players.on('add', function (key, item) {
- var html = '<li id="player-' + key + '"><a id="player-locate-' + key + '" data-id="' + key + '">' + item.player.name + '</a></li>';
- var added = false;
- $('li a', '#players ul').each(function(){
- if ($(this).text().toLowerCase() > item.player.name.toLowerCase()) {
- $(html).insertBefore($(this)).fadeIn('fast');
- added = true;
- return false;
- }
- });
- if(!added) $(html).appendTo($('#players ul')).fadeIn('fast');
- $('#players-title').html('Spieler (' + players.count() + ') <span class="accordion-toggle accordion-toggle-closed"></span>');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement