Commit 5b411e17 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic
Browse files

Bug 1775101: keep style when sorting tags in tags.php

behatnotneeded

Change-Id: I356d0b313896d6d1c84abed354c2f3737f853ecb
parent 25c29d47
......@@ -51,14 +51,14 @@ jQuery(function($) {
};
function sortTagAlpha(a, b) {
var aid = $(a).prop('id');
var bid = $(b).prop('id');
var aid = $(a).children().prop('id');
var bid = $(b).children().prop('id');
return aid.toLowerCase() < bid.toLowerCase() ? -1 : (aid.toLowerCase() > bid.toLowerCase() ? 1 : 0);
}
function sortTagFreq(a, b) {
var aid = $(a).prop('id');
var bid = $(b).prop('id');
var aid = $(a).children().prop('id');
var bid = $(b).children().prop('id');
return mytags[bid] - mytags[aid];
}
......@@ -67,14 +67,11 @@ jQuery(function($) {
function rewriteTagSortLink(id, elem) {
$(elem).on('click', function(e) {
e.preventDefault();
var elems = $(mytags_container).find('a.tag');
elems.sort(sort_functions[getUrlParameter('ts', $(this).prop('href'))]);
var ul = $(mytags_container).children();
var li = ul.children("li");
li.detach().sort(sort_functions[getUrlParameter('ts', $(this).prop('href'))]);
ul.append(li);
// FF needs spaces in between each element for wrapping
$(mytags_container).empty();
elems.each(function () {
$(mytags_container).append(this, ' ')
});
// set all tabs to inactive
$('ul.nav-tabs li').each(function() {
$(this).removeClass('active');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment