mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
fix popular pill selection
This commit is contained in:
@@ -12,8 +12,26 @@ define('forum/popular', ['forum/recent', 'forum/infinitescroll'], function(recen
|
|||||||
$(this).addClass('hide');
|
$(this).addClass('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
recent.selectActivePill();
|
selectActivePill();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function selectActivePill() {
|
||||||
|
var active = getActiveSection();
|
||||||
|
|
||||||
|
$('.nav-pills li').removeClass('active');
|
||||||
|
$('.nav-pills li a').each(function() {
|
||||||
|
var $this = $(this);
|
||||||
|
if ($this.attr('href').match(active)) {
|
||||||
|
$this.parent().addClass('active');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function getActiveSection() {
|
||||||
|
parts = window.location.href.split('/');
|
||||||
|
return parts[parts.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
return Popular;
|
return Popular;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user