tests/Leaflet/sl-application.js
/* =========================================================================
**  loadquery
** =========================================================================
** ajaxish loading of search and showcase results,
** so we can load the map first */
loadquery
ajaxish loading of search and showcase results,
so we can load the map first
loadquery ajaxish loading of search and showcase results so we can load the map first
function loadquery(doc, params)
{
    var error_response = "<div class=\"notice\" style=\"margin:60px 15px;\""
        +"<h3>We've encountered a problem</h3>"
        +"<p>We were unable to complete the search for the content you requested."
        +" Please continue exploring the map while we look into the cause. Thank you for your patience!</p>"
        +"</div>";
    var leftJustifyTitle = false;
    var ajaxParams = (leftJustifyTitle) ? "null" : params;
    $.ajax({
        url: doc,
        type: 'GET',
        data: ajaxParams,
        timeout: 10000,
        error: function(){
            $('#map-search-results .loader').remove();
            $('#map-search-results').append(error_response);
            mapquery();
        },
        success: function(data){
            $('#map-search-results .loader').remove();
            $('#map-search-results').append(data);
            if (leftJustifyTitle)
                $('#dest-guide-title').css('margin-left', '15px');
            if($('#location-heading').html() == 'Destination Guide Picks')
                $('#dest-guide-title').remove();
            var showcaseContainer = $('.showcase-container');
            if (showcaseContainer.length) {
                var showcaseContainerTop = showcaseContainer.position().top || '0px';
                showcaseContainer.css({
                    'position': 'absolute',
                    'top': showcaseContainerTop,
                    'bottom': '10px'
                });
            }
            mapquery();
        }
    });
}
function loadquery ( doc , params ) { var error_response = "<div class=\"notice\" style=\"margin:60px 15px;\"" + "<h3>We've encountered a problem</h3>" + "<p>We were unable to complete the search for the content you requested." + " Please continue exploring the map while we look into the cause. Thank you for your patience!</p>" + "</div>" ; var leftJustifyTitle = false ; var ajaxParams = ( leftJustifyTitle ) ? "null" : params ; $ . ajax ( { url : doc , type : 'GET' , data : ajaxParams , timeout : 10000 , error : function ( ) { $ ( '#map-search-results .loader' ) . remove ( ) ; $ ( '#map-search-results' ) . append ( error_response ) ; mapquery ( ) ; } , success : function ( data ) { $ ( '#map-search-results .loader' ) . remove ( ) ; $ ( '#map-search-results' ) . append ( data ) ; if ( leftJustifyTitle ) $ ( '#dest-guide-title' ) . css ( 'margin-left' , '15px' ) ; if ( $ ( '#location-heading' ) . html ( ) == 'Destination Guide Picks' ) $ ( '#dest-guide-title' ) . remove ( ) ; var showcaseContainer = $ ( '.showcase-container' ) ; if ( showcaseContainer . length ) { var showcaseContainerTop = showcaseContainer . position ( ) . top || '0px' ; showcaseContainer . css ( { 'position' : 'absolute' , 'top' : showcaseContainerTop , 'bottom' : '10px' } ) ; } mapquery ( ) ; } } ) ; }
loadquery
ajaxish loading of search and showcase results,
so we can load the map first
loadquery ajaxish loading of search and showcase results so we can load the map first
/* FORMATTING THE TITLES AT THE TOP OF THE SIDEBAR */ // If a destination is loaded, we adjust the CSS for the Destination Guide title // If a false destination is loaded, 'Your Location' is removed in a script in main.php. // Now we check to see if that happened, and if it did, we remove the duplicate title. /* END FORMATTING */ // Make this results area of the sidebar scroll by limiting its // height. We don't know until it's added to the page how far down // the sidebar it starts (that is, how much stuff is above it in // the sidebar). So it has to be layed out as a relative element // without placement at first for us to find its top.