Skip to content

Commit

Permalink
usermenu: Support metakey hold click when select
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Aug 11, 2017
1 parent 2077c1e commit 5186cca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/index/myProjectList_partial.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
@(project:Project, favored:Boolean, isLast:Boolean = false)
@import utils.TemplateHelper._

<li class="user-li @if(isLast){favored}" onclick="window.location='@routes.ProjectApp.goConventionMenu(project.owner, project.name)';">
<li class="user-li @if(isLast){favored}" data-location="@routes.ProjectApp.goConventionMenu(project.owner, project.name)">
<div class="project-list project-flex-container">
<div class="project-item project-item-container">
<div class="flex-item site-logo">
<i class="project-avatar">@if(hasProjectLogo(project)){<a href="@routes.ProjectApp.goConventionMenu(project.owner, project.name)" ><img class="logo" src="@urlToProjectLogo(project)"></a>}else{<span class="dummy-25px"> </span>}</i>
<i class="project-avatar">@if(hasProjectLogo(project)){<img class="logo" src="@urlToProjectLogo(project)">}else{<span class="dummy-25px"> </span>}</i>
</div>
<div class="projectName-owner flex-item">
<div class="project-name flex-item"><a href="@routes.ProjectApp.goConventionMenu(project.owner, project.name)">@project.name @if(project.isPrivate){<i class="yobicon-lock yobicon-small"></i>}</a></div>
<div class="project-name flex-item">@project.name @if(project.isPrivate){<i class="yobicon-lock yobicon-small"></i>}</div>
<div class="project-owner flex-item"><a href="@routes.UserApp.userInfo(project.owner)" >@project.owner</a></div>
</div>
</div>
Expand Down
9 changes: 9 additions & 0 deletions public/javascripts/common/yona.Usermenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ $(function() {
}
}

$(".user-ul > .user-li").on("click", function (e) {
var location = $(this).data('location');
if(e.metaKey) {
window.open(location, '_blank');
} else {
window.location = location;
}
});

$(".org-list > .star-org").on("click", function toggleOrgFavorite(e) {
e.stopPropagation();
var that = $(this);
Expand Down

0 comments on commit 5186cca

Please sign in to comment.