//shortcut support. arrow-up arrow-down and enter event. if (event.which == keyMap.down || event.which == keyMap.up) { var direction = event.which == keyMap.down ? true : false, $activeSelector = $('.wcSingleUser.active'), $tmpSelector;
//if current active selector has next or prev element and direction is matching //then execute switch active and keep unique if (((!!($tmpSelector = $activeSelector.next()) && direction) || (!!($tmpSelector = $activeSelector.prev()) && !direction)) && $tmpSelector.length) { $activeSelector.removeClass('active'); $tmpSelector.addClass('active'); } return; }