Changeset 171 for binary-improvements


Ignore:
Timestamp:
Sep 5, 2014, 10:54:12 PM (5 years ago)
Author:
alloc
Message:

Minor webserver files update

Location:
binary-improvements/webserver
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/webserver/css/style.css

    r163 r171  
    4343                1px 1px 0 #000;
    4444}
     45.inventoryButton {
     46        color: #00ff00;
     47        cursor: pointer;
     48}
     49#playerInventoryDialog {
     50        display:none;
     51}
     52.ui-dialog {
     53        z-index:1011 !important;
     54}
     55.ui-widget-overlay {
     56        z-index:1010 !important;
     57}
    4558
  • binary-improvements/webserver/index.html

    r163 r171  
    1616                MouseCoords: <span id="pos"></span>
    1717        </div>
    18         <div id="dialog-message" title="Player inventory" style="display:none">
     18        <div id="playerInventoryDialog" title="Player inventory">
    1919                Player: <span id="invPlayerName"></span>
    2020                <table class="invTable" id="bagTable">
  • binary-improvements/webserver/js/index.js

    r163 r171  
    180180                }
    181181
    182                 $( "#dialog-message" ).dialog({
     182                $( "#playerInventoryDialog" ).css("z-index", "1010").dialog({
    183183                        modal: true,
    184                         width: BAG_COLS*INV_ITEM_WIDTH + 60,
     184                        width: BAG_COLS*(INV_ITEM_WIDTH+14) + 20,
    185185                        buttons: {
    186186                                Ok: function() {
     
    190190                });
    191191        })
    192         .fail(function() {
     192        .fail(function(jqxhr, textStatus, error) {
    193193                console.log("Error fetching player inventory");
    194194        })
     
    214214                "</td>");
    215215}
     216
     217$(".leaflet-popup-pane").on('click.action', '.inventoryButton', function(event) {
     218        showInv($(this).data('steamid'));
     219});
    216220
    217221var setPlayerMarkers = function(data) {
     
    226230                        marker = L.marker([val.position.z, val.position.x]).bindPopup(
    227231                                "Player: " + val.name + "<br/>" +
    228                                 "<a onClick='showInv(\""+val.steamid+"\")'>Show inventory</a>"
     232                                "<a class='inventoryButton' data-steamid='"+val.steamid+"'>Show inventory</a>"
    229233                        );
    230234                        playersMappingList[val.steamid] = { online: !val.online };
     
    256260        $.getJSON( "../api/getplayerslocation")
    257261        .done(setPlayerMarkers)
    258         .fail(function() {
     262        .fail(function(jqxhr, textStatus, error) {
    259263                console.log("Error fetching players list");
    260264        })
Note: See TracChangeset for help on using the changeset viewer.