mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +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/materialize.min.css') }}" media="screen,projection"/>
|
||||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/opaque.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 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"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -39,16 +39,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
corpusListOptions = {
|
corpusList = new List("corpus-list", {valueNames: ["title"],
|
||||||
valueNames: ['title'],
|
|
||||||
page: 4,
|
page: 4,
|
||||||
pagination: true
|
pagination: true});
|
||||||
};
|
corpusList.on("filterComplete", updatePagination);
|
||||||
corpusList = new List("corpus-list", corpusListOptions);
|
corpusList.on("searchComplete", updatePagination);
|
||||||
/*
|
|
||||||
* TODO: Hide Pagination if there is only on page
|
|
||||||
* corpusListPagination = document.querySelector("#corpus-list .pagination");
|
|
||||||
*/
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
@ -113,12 +108,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
jobListOptions = {
|
var jobList = new List("job-list", {valueNames: ["title"],
|
||||||
valueNames: ['title'],
|
|
||||||
page: 4,
|
page: 4,
|
||||||
pagination: true
|
pagination: true});
|
||||||
};
|
jobList.on("filterComplete", updatePagination);
|
||||||
jobList = new List("job-list", jobListOptions);
|
jobList.on("searchComplete", updatePagination);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="new-corpus-modal" class="modal">
|
<div id="new-corpus-modal" class="modal">
|
||||||
|
Loading…
Reference in New Issue
Block a user