Commit 65b7522c authored by Matija Obreza's avatar Matija Obreza
Browse files

Page 0 shows filtering block, on page >0 the block can be toggled

parent 697f1232
......@@ -335,7 +335,7 @@ filter.inSvalbard=Safety duplicated in Svalbard
filter.mlsStat=MLS status of the accession
filter.available=Available for distribution
filter.download-dwca=Download DwCA
filter.add=View & modify filters
filter.add=Add filter
filter.additional=Additional filters
filter.apply=Apply
filter.close=Close
......
......@@ -40,7 +40,11 @@
</div>
<%--Filters--%>
<div id="allfilters" class="applied-filters">
<div id="toggleFilters" class="filter-toggler applied-filters hide">
<a href="#"><spring:message code="filters.modify-filters" /></a>
</div>
<div id="allfilters" class="applied-filters hide">
<a style="float: right" class="filter-toggler close-fil glyphicon glyphicon-remove" href="#"></a>
<ul class="nav nav-pills">
<li class="dropdown form-horizontal" id="menu1">
......@@ -67,6 +71,7 @@
</a>
</li>
</c:if>
</ul>
<c:forEach items="${allFilters}" var="filter">
......@@ -286,18 +291,12 @@
<content tag="javascript">
<script type="text/javascript">
var jsonData = ${fn:replace(jsonFilter,'_',':')};
var filterPick = [];
var page=${pagedData.number};
if(page==0){
$(".dropdown-toggle").hide();
$(".filter-block").show();
}
function setCharAt(str,index,chr) {
if(index > str.length-1) return str;
return str.substr(0,index) + chr + str.substr(index+1);
......@@ -494,6 +493,21 @@
}
}
$( document ).ready(function() {
if(page==0) {
$("#allfilters").removeClass("hide");
$("#toggleFilters").addClass("hide");
} else {
$("#allfilters").addClass("hide");
$("#toggleFilters").removeClass("hide");
}
$(".filter-toggler").on("click", function(ev) {
ev.preventDefault();
$("#allfilters").toggleClass("hide");
$("#toggleFilters").toggleClass("hide");
});
$(".bool-data").on("click", function () {
var value = $(this).val();
......@@ -560,7 +574,7 @@
t.autocomplete({ delay: 200, minLength: 3, source: t.attr('x-source'), messages: { noResults: '', results: function () {
} } });
});
});
</script>
</content>
</body>
......
......@@ -1307,16 +1307,16 @@ table.crop-details h4 {
/* Main column - Filters */
#allfilters {
padding: 10px;
}
#allfilters .filter-block {
background:#f8f7f5;
margin:0 0 5px 0;
padding:10px;
}
#allfilters .nav {
margin: 0 0 0.5em 0;
}
.filter-block input[type=checkbox] {
margin-right: 1em;
}
......
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