|
115
|
1 |
$(function(){ |
|
133
|
2 |
//filters |
|
|
3 |
$('.filters a').each(function(){ |
|
|
4 |
var text = $.trim($(this).text()); |
|
|
5 |
if(text.length > 30){ |
|
|
6 |
$(this).text(text.substr(0, 30) + '...') |
|
|
7 |
} |
|
|
8 |
}); |
|
119
|
9 |
//masonry |
|
132
|
10 |
var masonry465 = $('.masonry-465'); |
|
|
11 |
masonry465.masonry({ |
|
118
|
12 |
columnWidth: 465, |
|
132
|
13 |
itemSelector: '.item-masonry', |
|
118
|
14 |
gutter : 20 |
|
|
15 |
}); |
|
132
|
16 |
|
|
|
17 |
var masonry225 = $('.masonry-225'); |
|
|
18 |
masonry225.masonry({ |
|
|
19 |
columnWidth: 225, |
|
|
20 |
itemSelector: '.item-masonry', |
|
|
21 |
gutter : 16 |
|
|
22 |
}); |
|
138
|
23 |
|
|
|
24 |
function masonry177(){ |
|
|
25 |
var masonry177 = $('.masonry-177'); |
|
|
26 |
masonry177.masonry({ |
|
|
27 |
columnWidth: 177, |
|
|
28 |
itemSelector: '.item-masonry' |
|
|
29 |
}); |
|
|
30 |
} |
|
|
31 |
masonry177(); |
|
119
|
32 |
//popin |
|
131
|
33 |
$('.open-popin').bind('click', function(e){ |
|
118
|
34 |
e.preventDefault(); |
|
119
|
35 |
var target = $(this).attr('href'); |
|
|
36 |
$('.popin-wrap').fadeIn(function(){ |
|
|
37 |
$(target).show(); |
|
|
38 |
}); |
|
|
39 |
}); |
|
|
40 |
|
|
|
41 |
$('.close-popin, .popin-wrap').bind('click', function(e){ |
|
|
42 |
e.preventDefault(); |
|
|
43 |
e.stopPropagation(); |
|
|
44 |
$('.popin-wrap').fadeOut(function(){ |
|
|
45 |
$('.popin').hide(); |
|
|
46 |
}); |
|
|
47 |
}); |
|
|
48 |
|
|
|
49 |
$('.popin').bind('click', function(e){ |
|
|
50 |
e.stopPropagation(); |
|
118
|
51 |
}); |
|
128
|
52 |
//tag it |
|
132
|
53 |
if($('.tag-it').length){ |
|
|
54 |
var keywordsTagIt = $('.tag-it').tagit({ |
|
|
55 |
allowSpaces : true |
|
|
56 |
}); |
|
|
57 |
$('.list-key-add a').bind('click', function(e){ |
|
|
58 |
e.preventDefault(); |
|
|
59 |
var tag = $(this).attr('data-tag'); |
|
|
60 |
keywordsTagIt.tagit("createTag", tag); |
|
|
61 |
}); |
|
|
62 |
} |
|
138
|
63 |
//mosaic |
|
|
64 |
$('.toggle-comment').bind('click', function(e){ |
|
|
65 |
e.preventDefault(); |
|
|
66 |
$('.show-comment, .hide-comment').hide(); |
|
|
67 |
if($('.mosaic').length){ |
|
|
68 |
$('.mosaic').removeClass('mosaic').addClass('mosaic-comment'); |
|
|
69 |
$('.hide-comment').show(); |
|
|
70 |
}else{ |
|
|
71 |
$('.mosaic-comment').removeClass('mosaic-comment').addClass('mosaic'); |
|
|
72 |
$('.show-comment').show(); |
|
|
73 |
} |
|
|
74 |
masonry177(); |
|
|
75 |
}); |
|
133
|
76 |
|
|
138
|
77 |
$('.display-keyword').bind('click', function(e){ |
|
|
78 |
e.preventDefault(); |
|
|
79 |
var li = $(this).parents('li'), |
|
|
80 |
keyword = $(this).attr('data-keyword'); |
|
|
81 |
if(li.hasClass('disabled')){ |
|
|
82 |
$('li.keyword-'+keyword).find('.curtain').hide(); |
|
|
83 |
li.removeClass('disabled'); |
|
|
84 |
}else{ |
|
|
85 |
$('li.keyword-'+keyword).find('.curtain').show(); |
|
|
86 |
li.addClass('disabled'); |
|
|
87 |
} |
|
|
88 |
|
|
|
89 |
}); |
|
128
|
90 |
|
|
115
|
91 |
});//ready |