Changeset 32801 for main

Show
Ignore:
Timestamp:
22.02.2019 11:25:07 (10 months ago)
Author:
ak19
Message:

Fixed the marker bug that it can be dragged when there is no user logged in.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js

    r32771 r32801  
    358358            var callbackFunction = function(){console.log("Completed saving metadata changes. You must rebuild the collection for the changes to take effect.");}; 
    359359     
     360            // set 5th parameter, metapos (metadata position) or 7th param prevMetaValue (previous metadata value) to non-null if you want metamode=override to work 
     361            // if neither of these 2 are set, then metamode is changed to 'accumulate' instead. 
    360362            gs.functions.setArchivesMetadata(collection, site_name, nodeID, "Latitude", null, lat, null, "override", function(){callbackFunction();}); 
    361363            gs.functions.setArchivesMetadata(collection, site_name, nodeID, "Longitude", null, lng, null, "override", function(){callbackFunction();}); 
     
    397399     
    398400    var docEdit = (("docEdit" in gs.cgiParams) && (gs.cgiParams['docEdit'])); 
    399     var draggable_val = (docEdit) ? true : false; 
     401    //var draggable_val = (docEdit) ? true : false; 
     402     
     403    // When user logs out, the very first page they're returned to has logout set 
     404    // If the user logged out when leaving docEdit on, then the very first page has docEdit=1 AND logout. 
     405    // In that case, don't allow editing. Subsequent pages in logged out mode have neither logout nor docEdit=1 set. 
     406    var loggedOutVar = ("logout" in gs.cgiParams); 
     407     
     408    // Don't allow dragging if either 1. docEdit not on OR 2. logout is in the cgiParams 
     409    var draggable_val = (!docEdit || loggedOutVar) ? false : true; 
     410     
     411    console.log(gs.cgiParams); 
    400412     
    401413    var marker