Commit bb621a40 authored by Michal Hrusecky's avatar Michal Hrusecky 🦎

Another minor UI polishing

Mainly three dots in pager
parent 94cf9d4d
@keyframes spinner {
from {transform:rotate(0deg);}
to {transform: rotate(360deg);}
}
.spinner:after {
content: '';
box-sizing: border-box;
position: fixed;
top: 50%;
left: 50%;
width: 150px;
height: 150px;
margin-top: -75px;
margin-left: -75px;
border-radius: 50%;
border: 5px solid #ccc;
border-top-color: #00a2e2;
animation: spinner .6s linear infinite;
z-index: 100;
}
i {
padding-left: 5px;
padding-right: 5px;
......@@ -27,10 +5,8 @@ i {
#pakon-pager-page li {
display: inline;
margin: 5px;
text-decoration: underline;
}
#pakon-pager-page li.current-page {
text-decoration: none;
font-weight: bold;
}
......
......@@ -119,11 +119,21 @@ function render_results() {
}
var pager = '<ul>'
if(page_size > 0) {
for(x = 0; x < filtered_data.length / page_size; x++) {
if(x == page) {
pager += '<li class="current-page" onClick="goto_page(' + x + ')">' + x + '</li>';
} else {
pager += '<li onClick="goto_page(' + x + ')"><a href="#">' + x + '</a></li>';
let pages = filtered_data.length / page_size;
if(pages * page_size < filtered_data.length)
pages++;
let dots = false;
for(x = 0; x < pages; x++) {
if(x < 4 || x > pages - 4 || Math.abs(x-page) < 3){
if(x == page) {
pager += '<li class="current-page" onClick="goto_page(' + x + ')">' + x + '</li>';
} else {
pager += '<li onClick="goto_page(' + x + ')"><a href="#">' + x + '</a></li>';
}
dots = false;
} else if(!dots) {
pager += '<li>...</li>';
dots = true;
}
}
}
......
......@@ -104,6 +104,7 @@ function apply() {
function dnd() {
Foris.SpinnerDisplay('{% trans %}Loading data...{% endtrans %}');
$("#tagcloud").hide();
$("#tagcloud").css("height", '0px');
$("#apply-changes").prop("disabled", true);
$("#pakon-table-data").html('');
......@@ -112,6 +113,7 @@ function dnd() {
function available() {
$("#apply-changes").prop("disabled", false);
Foris.SpinnerRemove();
$("#tagcloud").fadeIn('slow');
}
function zp(data) {
......@@ -185,7 +187,9 @@ $(document).ready(function () {
add_hostname_filter($(this).text());
}
});
$("#tagcloud").fadeIn('slow');
} else {
$("#tagcloud").hide();
$("#tagcloud").css("height", '0px');
}
if(e.data.sort_by) {
......
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