Index: binary-improvements/webserver/css/style.css
===================================================================
--- binary-improvements/webserver/css/style.css	(revision 168)
+++ binary-improvements/webserver/css/style.css	(revision 171)
@@ -43,3 +43,16 @@
 		1px 1px 0 #000;
 }
+.inventoryButton {
+	color: #00ff00;
+	cursor: pointer;
+}
+#playerInventoryDialog {
+	display:none;
+}
+.ui-dialog {
+	z-index:1011 !important;
+}
+.ui-widget-overlay {
+	z-index:1010 !important;
+}
 
Index: binary-improvements/webserver/index.html
===================================================================
--- binary-improvements/webserver/index.html	(revision 168)
+++ binary-improvements/webserver/index.html	(revision 171)
@@ -16,5 +16,5 @@
 		MouseCoords: <span id="pos"></span>
 	</div>
-	<div id="dialog-message" title="Player inventory" style="display:none">
+	<div id="playerInventoryDialog" title="Player inventory">
 		Player: <span id="invPlayerName"></span>
 		<table class="invTable" id="bagTable">
Index: binary-improvements/webserver/js/index.js
===================================================================
--- binary-improvements/webserver/js/index.js	(revision 168)
+++ binary-improvements/webserver/js/index.js	(revision 171)
@@ -180,7 +180,7 @@
 		}
 
-		$( "#dialog-message" ).dialog({
+		$( "#playerInventoryDialog" ).css("z-index", "1010").dialog({
 			modal: true,
-			width: BAG_COLS*INV_ITEM_WIDTH + 60,
+			width: BAG_COLS*(INV_ITEM_WIDTH+14) + 20,
 			buttons: {
 				Ok: function() {
@@ -190,5 +190,5 @@
 		});
 	})
-	.fail(function() {
+	.fail(function(jqxhr, textStatus, error) {
 		console.log("Error fetching player inventory");
 	})
@@ -214,4 +214,8 @@
 		"</td>");
 }
+
+$(".leaflet-popup-pane").on('click.action', '.inventoryButton', function(event) {
+	showInv($(this).data('steamid'));
+});
 
 var setPlayerMarkers = function(data) {
@@ -226,5 +230,5 @@
 			marker = L.marker([val.position.z, val.position.x]).bindPopup(
 				"Player: " + val.name + "<br/>" +
-				"<a onClick='showInv(\""+val.steamid+"\")'>Show inventory</a>" 
+				"<a class='inventoryButton' data-steamid='"+val.steamid+"'>Show inventory</a>"
 			);
 			playersMappingList[val.steamid] = { online: !val.online };
@@ -256,5 +260,5 @@
 	$.getJSON( "../api/getplayerslocation")
 	.done(setPlayerMarkers)
-	.fail(function() {
+	.fail(function(jqxhr, textStatus, error) {
 		console.log("Error fetching players list");
 	})
