Skip to content

Commit

Permalink
css: Support image popup at contents on click
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Sep 24, 2017
1 parent 1ad9eae commit 1ee4a9b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/less/_markdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ code {
border:1px solid rgba(0,0,0,0.1);
.box-shadow(2px 2px 5px rgba(0,0,0,0.15));
.box-sizing(border-box);
max-height: 300px;
}

ul {
Expand Down
17 changes: 17 additions & 0 deletions app/views/layout.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/usermenu.css")">
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/yobi.css")">
<link rel='stylesheet' href="@routes.Assets.at("javascripts/lib/nprogress/nprogress.css")"/>
<link rel="stylesheet" href="@routes.Assets.at("javascripts/lib/magnific-popup/magnific-popup.css")" />
<script type="text/javascript" src="@routes.Assets.at("javascripts/yona-layout.js")"></script>

</head>
Expand Down Expand Up @@ -58,6 +59,22 @@
var UsermenuUrl = "@routes.UserApp.usermenuTabContentList()";
</script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yona.Usermenu.js")"></script>
<script src="@routes.Assets.at("javascripts/lib/magnific-popup/jquery.magnific-popup.js")"></script>

<script>
$(".markdown-wrap").find("img").on("click", function () {
var img = $(this);
$.magnificPopup.open({
items: {
src: img.attr("src")
},
type: 'image'
});
}).on("mouseover", function () {
var img = $(this);
img.css("cursor", "pointer");
});
</script>

@if(Application.SEND_YONA_USAGE){
<script>
Expand Down

0 comments on commit 1ee4a9b

Please sign in to comment.