Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
e665ea05
Commit
e665ea05
authored
Jan 31, 2017
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Ctrl+Click support
parent
ff4950b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
app/assets/javascripts/todos.js.es6
app/assets/javascripts/todos.js.es6
+18
-3
No files found.
app/assets/javascripts/todos.js.es6
View file @
e665ea05
...
...
@@ -147,13 +147,28 @@
goToTodoUrl(e) {
const todoLink = $(this).data('url');
let targetLink = $(e.target).attr('href');
if ($(e.target).is('img')) { // See if clicked target was Avatar
targetLink = $(e.target).parent().attr('href'); // Parent of Avatar is link
}
if (!todoLink) {
return;
}
// Allow Meta-Click or Mouse3-click to open in a new tab
if (e.metaKey || e.which === 2) {
// Allow Meta-Click (Cmd+Click or Ctrl+Click)
// or Mouse3-click (middle-click)
// to open in a new tab
if (e.metaKey || e.ctrlKey || e.which === 2) {
e.preventDefault();
return window.open(todoLink, '_blank');
// Meta-Click on username leads to different URL than todoLink.
// Turbolinks can resolve that URL, but window.open requires URL manually.
if (targetLink !== todoLink) {
return window.open(targetLink, '_blank');
} else {
return window.open(todoLink, '_blank');
}
} else {
return gl.utils.visitUrl(todoLink);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment