61 enabledItems.removeClass("disabled"); |
61 enabledItems.removeClass("disabled"); |
62 } |
62 } |
63 |
63 |
64 keywordslist.slice(0,100).forEach(function(kw) { |
64 keywordslist.slice(0,100).forEach(function(kw) { |
65 var li = $('<li class="box-shadow-2">'), |
65 var li = $('<li class="box-shadow-2">'), |
66 outera = $('<a class="display-keyword" href="#">'), |
66 texta = $('<a class="display-keyword" href="#">'), |
67 innera = $('<a class="icon-action" href="#">'); |
67 actiona = $('<a class="icon-action" href="#">'); |
68 outera.text(kw.keyword + ' '); |
68 texta.text(kw.keyword + ' '); |
69 outera.append(innera); |
69 li.append(actiona); |
70 li.append(outera); |
70 li.append(texta); |
71 kw.li = li; |
71 kw.li = li; |
72 li.click(function() { |
72 li.click(function() { |
73 if (kw.enabled) { |
73 var allothersdisabled = keywordslist.reduce(function(mem, k) { |
|
74 return mem && (k === kw || !k.enabled); |
|
75 }, true); |
|
76 if (allothersdisabled) { |
|
77 keywordslist.forEach(function(k) { |
|
78 k.enabled = true; |
|
79 }); |
|
80 } else { |
74 keywordslist.forEach(function(k) { |
81 keywordslist.forEach(function(k) { |
75 k.enabled = false; |
82 k.enabled = false; |
76 }); |
83 }); |
77 kw.enabled = true; |
84 kw.enabled = true; |
78 } else { |
|
79 keywordslist.forEach(function(k) { |
|
80 k.enabled = true; |
|
81 }); |
|
82 } |
85 } |
83 updateKeywords(); |
86 updateKeywords(); |
84 return false; |
87 return false; |
85 }); |
88 }); |
86 innera.click(function() { |
89 actiona.click(function() { |
87 kw.enabled = !kw.enabled; |
90 kw.enabled = !kw.enabled; |
88 updateKeywords(); |
91 updateKeywords(); |
89 return false; |
92 return false; |
90 }); |
93 }); |
91 filterlist.append(li); |
94 filterlist.append(li); |
100 }else{ |
103 }else{ |
101 $('.mosaic-comment').removeClass('mosaic-comment').addClass('mosaic'); |
104 $('.mosaic-comment').removeClass('mosaic-comment').addClass('mosaic'); |
102 $('.show-comment').show(); |
105 $('.show-comment').show(); |
103 } |
106 } |
104 updateMasonry(); |
107 updateMasonry(); |
|
108 }); |
|
109 |
|
110 //filters |
|
111 $('.filters a').each(function(){ |
|
112 var text = $.trim($(this).text()); |
|
113 if(text.length > 26){ |
|
114 $(this).text(text.substr(0, 26) + '...') |
|
115 } |
105 }); |
116 }); |
106 |
117 |
107 //################## |
118 //################## |
108 /* |
119 /* |
109 $(document).on('click','.display-keyword', function(e){ |
120 $(document).on('click','.display-keyword', function(e){ |