Fixed hotkeys bug

This commit is contained in:
Marcin Kurczewski 2013-10-25 15:47:42 +02:00
parent c662d52d62
commit c648cd848d

View file

@ -121,7 +121,7 @@ $(function()
$.ajax(ajaxData); $.ajax(ajaxData);
}); });
Mousetrap.bind('a', function() { window.location = $('#sidebar .left a').attr('href'); }); Mousetrap.bind('a', function() { var url = $('#sidebar .left a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; });
Mousetrap.bind('d', function() { window.location = $('#sidebar .right a').attr('href'); }); Mousetrap.bind('d', function() { var url = $('#sidebar .right a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; });
Mousetrap.bind('e', function() { $('li.edit a').trigger('click'); return false; }); Mousetrap.bind('e', function() { $('li.edit a').trigger('click'); return false; });
}); });