Opening bag...
+
diff --git a/www/css/app.css b/www/css/app.css index 40239d0..ba184a3 100644 --- a/www/css/app.css +++ b/www/css/app.css @@ -14,7 +14,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. } .popup { - overflow-y: scroll; + overflow-y: auto; } #settings-bin .card { diff --git a/www/css/home.css b/www/css/home.css index 8841969..b620030 100644 --- a/www/css/home.css +++ b/www/css/home.css @@ -13,6 +13,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. background-color: rgba(23, 23, 23, 0.75); } +.solid-popup { + background-color: rgba(23, 23, 23, 1); +} + #menu-popup { overflow-y: hidden; } diff --git a/www/css/inventory.css b/www/css/inventory.css index 1bc5383..1533235 100644 --- a/www/css/inventory.css +++ b/www/css/inventory.css @@ -4,18 +4,30 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#item-bin .card { +.item-bin .card { text-align: center; min-height: 300px; position: relative; } -#item-bin .card .badge { +.item-bin .card .badge { position: absolute; top: -10px; right: -10px; } -#item-bin .item .item-icon { +.item-bin .item .item-icon { font-size: 6em; +} + +.item-bin-horizontal { + overflow-x: scroll; +} + +.item-bin-horizontal .card { + max-height: 100px; +} + +.item-bin-horizontal .item .item-icon { + font-size: 4em; } \ No newline at end of file diff --git a/www/index.html b/www/index.html index bf1fc9d..21a5e8b 100644 --- a/www/index.html +++ b/www/index.html @@ -52,3 +52,4 @@ + diff --git a/www/js/home.js b/www/js/home.js index 03e727d..9d24572 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -90,7 +90,7 @@ function openPlace(id, name) { $("#place-popup").data("placeid", id); $("#place-popup").data("placepopupnonce", placepopupnonce); $("#place-title").text(name); - app.popup.open("#place-popup"); + app.popup.open("#place-popup"); updatePlaceStats(id, function (success) { $("#place-popup .preloader").addClass("display-none"); @@ -141,6 +141,7 @@ function updatePlaceStats(id, successCallback, errorCallback) { $("#place-artifact-list").append(""); }); } else { + $("#place-artifact-list").html(""); $("#place-info").addClass("color-white"); $("#place-image").attr("src", "img/place/white.png"); $("#magic-action-label").text("Control"); @@ -183,4 +184,9 @@ $("#magic-action-button").click(function () { closeTimeout: 1000 * 2 }); }); +}); + +$("#item-action-button").click(function () { + app.popup.open("#inventory-popup"); + loadInventory(function () {}, "#inventory-popup"); }); \ No newline at end of file diff --git a/www/js/inventory.js b/www/js/inventory.js index 3e37680..d2ab6e0 100644 --- a/www/js/inventory.js +++ b/www/js/inventory.js @@ -4,24 +4,37 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +var inventoryloadedfromplacepopup = false; -function loadInventory(reload) { +function loadInventory(reload, target) { + if (typeof target != "string") { + target = "#inventory-page"; + } + inventoryloadedfromplacepopup = false; + if ($("#place-popup").hasClass("modal-in")) { + inventoryloadedfromplacepopup = true; + } if (typeof reload != "boolean") { reload = false; // Make it reload if there's already stuff there, // to keep the items from disappearing and coming back - if ($("#item-bin .item-col").length > 0) { + if ($(target + " .item-bin .item-col").length > 0) { reload = true; } } if (reload == false) { - $("#item-bin .item-col").remove(); - $("#item-bin #bag-preloader").removeClass("display-none"); + $(target + " .item-bin .item-col").remove(); + $(target + " .item-bin .bag-preloader").removeClass("display-none"); } callAPI("inventory", { username: localStorage.getItem("username"), password: localStorage.getItem("password") }, function (resp) { + if (resp.items.length == 0) { + $(target + " .bag-empty").removeClass("display-none"); + } else { + $(target + " .bag-empty").addClass("display-none"); + } var items = []; for (var i = 0; i < resp.items.length; i++) { var item = resp.items[i]; @@ -41,49 +54,57 @@ function loadInventory(reload) { } } - $("#item-bin .item-col").remove(); + $(target + " .item-bin .item-col").remove(); if (reload == false) { - $("#item-bin #bag-preloader").addClass("display-none"); + $(target + " .item-bin .bag-preloader").addClass("display-none"); } items.forEach(function (item) { - $("#item-bin").append('