Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't react when user wants to open a link in a new tab
Fixes #846
  • Loading branch information
gaearon committed Sep 12, 2015
commit c14ba7ce3416c560b0043e2dd8e4ced8e43f6a6d
12 changes: 12 additions & 0 deletions theme/javascript/core/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,19 @@ define([
events.trigger("page.change");
};

var isLeftClickEvent = function (e) {
return e.button === 0;
};

var isModifiedEvent = function (e) {
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
};

var handlePagination = function (e) {
if (isModifiedEvent(e) || !isLeftClickEvent(e)) {
return;
}

e.stopPropagation();
e.preventDefault();

Expand Down