Commit c8ec4bc1 authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

"MAP LIST" button should be disabled when there are no saved maps.

parent 7e6f694a
......@@ -1896,7 +1896,6 @@ h2.short {
font-size: 14px;
border: none;
border-radius: 4px;
display: block;
text-transform: none;
font-family: "Roboto-Regular";
}
......
......@@ -119,11 +119,12 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><spring:message
code="cancel"/></button>
<button type="button" class="btn btn-primary" data-dismiss="modal">
<spring:message code="cancel"/>
</button>
<button id="save-filter" type="button" class="btn btn-primary" data-dismiss="modal">
<spring:message
code="save"/></button>
<spring:message code="save"/>
</button>
</div>
</div>
</div>
......@@ -565,28 +566,35 @@
$("#get-filters").on("click", function (event) {
event.preventDefault();
$.ajax({
url: "/savedmaps/get",
type: "get",
dataType: "json",
contentType: 'application/json; charset=utf-8',
success: function (data) {
$.each(data, function (idx, filter) {
var li = "<li><label class='saved-filter' x-fil='" + filter.filter + "' x-color='" + filter.color + "'><input style='margin-right: 10px;margin-left: 5px' type='checkbox'>" + filter.title + "</label></li>";
if ($("#enabled-filters").is(":visible")) {
$("#enabled-filters").append(li);
} else {
$("#enabled-filters").empty();
if ($("#enabled-filters").is(":visible")) {
$("#enabled-filters").hide();
$("#enabled-filters").empty();
} else {
$.ajax({
url: "/savedmaps/get",
type: "get",
dataType: "json",
contentType: 'application/json; charset=utf-8',
success: function (data) {
if (data.length !== 0) {
$.each(data, function (idx, filter) {
var li = $("<li/>")
.append($("<label>").addClass("saved-filter").attr("x-fil", filter.filter).attr("x-color", filter.color)
.append($("<input type='checkbox' style='margin-right: 10px;margin-left: 5px' />"))
.append(filter.title)
.append("</label>"));
$("#enabled-filters").append(li);
});
$("#enabled-filters").show();
}
});
},
error: function (error) {
console.log(error)
}
});
$("#enabled-filters").toggle();
},
error: function (error) {
console.log(error)
}
});
}
});
$("#selectArea").hide();
......@@ -913,9 +921,6 @@
function applyFilters() {
var stepValue = (parseInt(localStorage.getItem("historyStep")) + 1);
localStorage.setItem("historyStep", stepValue);
// BrowseUtil.cleanJsonData(jsonData);
var filter = JSON.stringify(jsonData);
var requestUrl = '//' + location.host + location.pathname +
"?filter=" + encodeURIComponent(filter);
......
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