mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 10:34:17 +00:00
Toggle paginations if one or less items are displayed.
This commit is contained in:
parent
ea399d2cdc
commit
47c3edeb7f
@ -12,6 +12,17 @@
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/materialize.min.css') }}" media="screen,projection"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/opaque.css') }}" media="screen,projection"/>
|
||||
<script src="{{ url_for('static', filename='js/list.js') }}"></script>
|
||||
<script>
|
||||
// Utils
|
||||
var updatePagination = function(list) {
|
||||
pagination = list.listContainer.querySelector(".pagination");
|
||||
if (pagination.childElementCount <= 1) {
|
||||
pagination.classList.add("hide");
|
||||
} else {
|
||||
pagination.classList.remove("hide");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -39,16 +39,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
corpusListOptions = {
|
||||
valueNames: ['title'],
|
||||
corpusList = new List("corpus-list", {valueNames: ["title"],
|
||||
page: 4,
|
||||
pagination: true
|
||||
};
|
||||
corpusList = new List("corpus-list", corpusListOptions);
|
||||
/*
|
||||
* TODO: Hide Pagination if there is only on page
|
||||
* corpusListPagination = document.querySelector("#corpus-list .pagination");
|
||||
*/
|
||||
pagination: true});
|
||||
corpusList.on("filterComplete", updatePagination);
|
||||
corpusList.on("searchComplete", updatePagination);
|
||||
</script>
|
||||
|
||||
<div class="col s12">
|
||||
@ -113,12 +108,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jobListOptions = {
|
||||
valueNames: ['title'],
|
||||
var jobList = new List("job-list", {valueNames: ["title"],
|
||||
page: 4,
|
||||
pagination: true
|
||||
};
|
||||
jobList = new List("job-list", jobListOptions);
|
||||
pagination: true});
|
||||
jobList.on("filterComplete", updatePagination);
|
||||
jobList.on("searchComplete", updatePagination);
|
||||
</script>
|
||||
|
||||
<div id="new-corpus-modal" class="modal">
|
||||
|
Loading…
Reference in New Issue
Block a user