Changeset 25868


Ignore:
Timestamp:
2012-06-28T13:22:55+12:00 (12 years ago)
Author:
sjm84
Message:

The loop that displays the names of the places above the markers will now only loop through the documents on the page, rather than all the pages on the map

File:
1 edited

Legend:

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

    r25462 r25868  
    300300    }
    301301
    302     if(_docList.loopIndex >= visibleMarkers.length)
    303     {
    304         _docList.loopIndex = 0;
    305     }
    306 
    307302    clearAllInfoBoxes();
    308 
    309     var doc = visibleMarkers[_docList.loopIndex];
    310     var elem = document.getElementById("div" + doc.nodeID);
    311     if(elem)
    312     {
    313         elem.style.background = "#BBFFBB";
    314         setTimeout(function(){elem.style.background = "";}, 2000);
     303   
     304    var elem = null;
     305    while(!elem)
     306    {
     307        if(_docList.loopIndex >= visibleMarkers.length)
     308        {
     309            _docList.loopIndex = 0;
     310        }
     311
     312        var doc = visibleMarkers[_docList.loopIndex];
     313        var elem = document.getElementById("div" + doc.nodeID);
     314        if(elem)
     315        {
     316            elem.style.background = "#BBFFBB";
     317            setTimeout(function(){elem.style.background = "";}, 2000);
     318        }
     319        _docList.loopIndex++;
    315320    }
    316321    doc.marker.markerInfo.open(_map, doc.marker);
    317    
    318     _docList.loopIndex++;
    319322}
    320323
Note: See TracChangeset for help on using the changeset viewer.