Difference between revisions of "Widget:indexSorterGrouper"

From Girls' Frontline Wiki
Jump to navigation Jump to search
m (First element, too)
(Removing paragraph so it's stable as before)
 
Line 2: Line 2:
 
RLQ.push(['jquery', function () {
 
RLQ.push(['jquery', function () {
 
   $(document).ready(function() {
 
   $(document).ready(function() {
 +
    // initially remove the paragraph
 +
    var parents = $(".mw-headline").closest("h2");
 +
    parents.each(function() {
 +
      var parent = $(this);
 +
      var paragraph = parent.next('p');
 +
      paragraph.replaceWith(paragraph.children());
 +
    });
 +
   
 
     // For now, we have to make sure the data is there (Change the template, dammit!)
 
     // For now, we have to make sure the data is there (Change the template, dammit!)
 
$(".card-bg-small").each(function() {
 
$(".card-bg-small").each(function() {
Line 296: Line 304:
 
     var parent = $(this);
 
     var parent = $(this);
 
     // All elements inside the paragraph after the h2 which have special class
 
     // All elements inside the paragraph after the h2 which have special class
     var elements = parent.next().children().nextUntil("h2", ".card-bg-small").addBack();
+
     var elements = parent.nextUntil("h2", ".card-bg-small");
    // Or the old way...
 
    if (elements.length == 0) elements = parent.nextUntil("h2", ".card-bg-small").addBack();
 
 
    
 
    
 
     elements.detach().sort(comparer);
 
     elements.detach().sort(comparer);

Latest revision as of 18:41, 10 November 2019


 

Released on this server:

Some heading