Browse Source

Center map when card is small

master
Skylar Ittner 3 years ago
parent
commit
b991849f5b
  1. 6
      www/css/styles.css
  2. 15
      www/js/home.js

6
www/css/styles.css

@ -112,7 +112,7 @@ html.md .navbar .link {
position: absolute;
top: 0;
left: 0;
height: 100%;
height: 25em;
width: 100%;
opacity: 1;
transition: opacity 0.5s linear, top 0.25s linear;
@ -137,13 +137,13 @@ html.md .navbar .link {
z-index: 999999;
}
#map .leaflet-control-attribution, #map .leaflet-control-zoom {
#map .leaflet-control {
opacity: 0;
visibility: hidden;
transition: visibility 0s, opacity 0.5s;
}
.card-opened #map .leaflet-control-attribution, .card-opened #map .leaflet-control-zoom {
.card-opened #map .leaflet-control {
opacity: 1;
visibility: visible;
}

15
www/js/home.js

@ -17,11 +17,17 @@ $(".view-main").on("card:open", ".card-expandable", function () {
$(".ptr-preloader").addClass("display-none");
});
$(".view-main").on("card:closed", "#map-card", function () {
leafletgllayer._glMap.setPitch(0);
$("#map-card").on("card:closed card:opened", function () {
leafletmap.invalidateSize();
});
$("#map-card").on("card:open", function () {
leafletgllayer._glMap.setPitch(20);
});
$("#map-card").on("card:close", function () {
leafletgllayer._glMap.setPitch(0);
});
$(".view-main").on("card:closed", ".card-expandable", function () {
$(".ptr-preloader").removeClass("display-none");
});
@ -45,11 +51,6 @@ function loadBalance(callback) {
});
}
function openMapCard() {
leafletgllayer._glMap.setPitch(20);
leafletmap.invalidateSize();
}
function loadQrCode(callback) {
$("#receive-loading").removeClass("display-none");
callAPI("getprofile", {

Loading…
Cancel
Save