BUGFIX: fix ~ and ` navigation

Was completely broken.
This commit is contained in:
Sam 2014-06-10 16:09:38 +10:00
parent 96f3ced4f9
commit cbb2cc3911

View File

@ -231,9 +231,12 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
},
_changeSection: function(direction) {
var $sections = $('#navigation-bar').find('li'),
index = $sections.index('.active');
var $sections = $('#navigation-bar li'),
active = $('#navigation-bar li.active'),
index = $sections.index(active) + direction;
$sections.eq(index + direction).find('a').click();
if(index >= 0 && index < $sections.length){
$sections.eq(index).find('a').click();
}
}
});