mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 19:42:37 +02:00
don't repeat the cats even when filtering by lang
This commit is contained in:
parent
4492002860
commit
940f7315a5
1 changed files with 11 additions and 1 deletions
|
@ -5,11 +5,21 @@
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
var cat = '';
|
||||||
$('#lang-selector a').each(function(i, item){
|
$('#lang-selector a').each(function(i, item){
|
||||||
$(item).click(function(){
|
$(item).click(function(){
|
||||||
|
|
||||||
$('#posts-list a[class="' + item.lang + '"]').each(function(i, article){
|
$('#posts-list a[class="' + item.lang + '"]').each(function(i, article){
|
||||||
$(article).show();
|
$(article).show();
|
||||||
|
var catDiv = $($(article).find('span[class*="category"]'))[0];
|
||||||
|
if (catDiv != undefined){
|
||||||
|
console.log(catDiv.innerText);
|
||||||
|
console.log(cat);
|
||||||
|
|
||||||
|
if (catDiv.innerText == cat){
|
||||||
|
$(catDiv).hide();
|
||||||
|
}
|
||||||
|
cat = catDiv.innerText;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#posts-list a[class!="' + item.lang + '"]').each(function(i, article){
|
$('#posts-list a[class!="' + item.lang + '"]').each(function(i, article){
|
||||||
|
|
Loading…
Reference in a new issue