Update 2 column author list view

pull/932/head
Ozzieisaacs 6 years ago
parent 772f978b45
commit dc93222579

@ -22,8 +22,17 @@ $("#desc").click(function() {
return;
}
var list = $('#list');
var second = $('#second');
var listItems = list.children(".row");
list.append(listItems.get().reverse());
var reversed, elementLength, middle;
Array.prototype.push.apply(listItems,second.children(".row"))
reversed = listItems.get().reverse();
elementLength = reversed.length;
middle = parseInt(elementLength / 2) + (elementLength % 2);
list.append(reversed.slice(0, middle));
second.append(reversed.slice(middle,elementLength));
direction = 0;
});
@ -33,8 +42,15 @@ $("#asc").click(function() {
return;
}
var list = $("#list");
var second = $('#second');
var listItems = list.children(".row");
list.append(listItems.get().reverse());
Array.prototype.push.apply(listItems,second.children(".row"));
reversed = listItems.get().reverse();
elementLength = reversed.length;
middle = parseInt(elementLength / 2) + (elementLength % 2);
list.append(reversed.slice(0, middle));
second.append(reversed.slice(middle,elementLength));
direction = 1;
});

@ -17,6 +17,10 @@
<div class="container">
<div id="list" class="col-xs-12 col-sm-6">
{% for entry in entries %}
{% if loop.index0 == (loop.length/2+loop.length%2)|int and loop.length > 20 %}
</div>
<div id="second" class="col-xs-12 col-sm-6">
{% endif %}
<div class="row" data-id="{% if entry[0].sort %}{{entry[0].sort}}{% else %}{% if entry.name %}{{entry.name}}{% else %}{{entry[0].name}}{% endif %}{% endif %}">
<div class="col-xs-2 col-sm-2 col-md-1" align="left"><span class="badge">{{entry.count}}</span></div>
<div class="col-xs-10 col-sm-10 col-md-11"><a id="list_{{loop.index0}}" href="{% if entry.format %}{{url_for(folder, data=data, sort='new', book_id=entry.format )}}{% else %}{{url_for(folder, data=data, sort='new', book_id=entry[0].id )}}{% endif %}">

Loading…
Cancel
Save