Changeset 300


Ignore:
Timestamp:
2018-01-18 23:44:19 (7 years ago)
Author:
amg0
Message:

fix for variable savings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/iPhoneLocator/J_IPhone.js

    r299 r300  
    435435    return names.split(','); 
    436436} 
    437  
    438 // function addSaveButtonForMap(deviceID) { 
    439     // if (jQuery("#status_display").length>0) { 
    440         // var e = jQuery("#status_display"); 
    441         // e.parent().remove(); 
    442     // }  
    443      
    444     // jQuery("table#tbl_map tbody").append("<tr><td>test</td><td></td></tr>"); 
    445      
    446     // // initialize the save Database to Null object 
    447     // jQuery( "#status_display" ).data( "DBsave",{}); 
    448      
    449 // } 
    450 // function addSaveButton(deviceID) { 
    451     // if (jQuery("#status_display").length>0) { 
    452         // var e = jQuery("#status_display"); 
    453         // e.parent().remove(); 
    454     // }  
    455      
    456     // jQuery("div.left_menu").append("<div class='menu_item'><div class='menu_item_center' id='status_display' onclick='saveToVera("+deviceID+")'>Save</div></div>"); 
    457      
    458     // // initialize the save Database to Null object 
    459     // jQuery( "#status_display" ).data( "DBsave",{}); 
    460      
    461 // } 
    462437 
    463438function initializeAppleNames( deviceID ) { 
     
    972947function saveVar(deviceID,  service, varName, varVal, reload) 
    973948{ 
    974     set_device_state (deviceID, service, varName, varVal, 0);    
     949    // set_device_state (deviceID, service, varName, varVal, 0);     
     950    // 3rd method : updated immediately but not reflected ! 
     951    var url = buildVariableSetUrl( deviceID, varName, varVal) 
     952    var jqxhr = jQuery.ajax({ 
     953        url:url, 
     954        async:false     // important to be in synchronous mode in that case 
     955    })   
     956    .done(function() { 
     957        // success, remove pending save for this variable 
     958 
     959    }) 
     960    .fail(function() { 
     961        // error, keep track of error, keep entry in DB for next save 
     962 
     963    }); 
    975964} 
    976965 
Note: See TracChangeset for help on using the changeset viewer.