Skip to content

Commit

Permalink
Feature: Group Picture for Archive and Details page. #295
Browse files Browse the repository at this point in the history
  • Loading branch information
iissnan committed Sep 30, 2015
1 parent ca85e80 commit 7aa1095
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
27 changes: 24 additions & 3 deletions source/css/_common/_component/group-pictures.styl
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
.posts-expand .group-picture {
.post .group-picture {
img {
box-sizing: border-box;
padding: 0 3px;
border: none;
}
}

.posts-expand .group-picture-row {
.post .group-picture-row {
overflow: hidden;
margin-top: 6px;
&:first-child { margin-top: 0; }
}

.posts-expand .group-picture-column { float: left; }
.post .group-picture-column { float: left; }

.page-post-detail .post-body .group-picture-column {
float: none;
margin-top: 10px;
width: auto !important;
img { margin: 0 auto; }
}

.page-archive {
.group-picture-container { overflow: hidden; }
.group-picture-row {
float: left;
&:first-child { margin-top: 6px; }
}

.group-picture-column {
max-width: 150px;
max-height: 150px;
}
}
10 changes: 7 additions & 3 deletions source/js/fancy-box.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
$(document).ready(function() {
$('.content img').each(function () {
$('.content img').not('.group-picture img').each(function () {
var $image = $(this);
var $imageWrapLink = $image.parent('a');

if ($imageWrapLink.size() < 1) {
$imageWrapLink = $image.wrap('<a href="' + this.getAttribute('src') + '"></a>').parent('a');
}

$imageWrapLink.addClass('fancybox');
if(this.title){
$imageWrapLink.attr("title",this.title); //make sure img title tag will show correctly in fancybox

//make sure img title tag will show correctly in fancybox
if (this.title) {
$imageWrapLink.attr("title", this.title);
}

});
});
$('.fancybox').fancybox({
Expand Down

0 comments on commit 7aa1095

Please sign in to comment.