FIX: If a user uses the keyboard to navigate, don't bubble up the event.

This commit is contained in:
Robin Ward 2014-12-15 12:53:41 -05:00
parent da7fefa263
commit a2c97b9e6b
1 changed files with 3 additions and 2 deletions

View File

@ -189,7 +189,8 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
_bindToClick: function(selector, binding) {
binding = binding.split(',');
this.keyTrapper.bind(binding, function() {
this.keyTrapper.bind(binding, function(e) {
e.preventDefault();
$(selector).click();
});
},
@ -250,7 +251,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
}
tabLoc.focus();
}
var rgx = new RegExp("post-cloak-(\\d+)").exec($article.parent()[0].id);
if (rgx === null || typeof rgx[1] === 'undefined') {
this._scrollList($article, direction);