From: John Firebaugh Date: Wed, 13 Nov 2013 21:50:36 +0000 (-0800) Subject: Remove "Loading..." from browse for now X-Git-Tag: live~5234^2~80 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/4863a9490601d954139e17741dd5144adf99f621?ds=inline Remove "Loading..." from browse for now --- diff --git a/app/assets/javascripts/index/browse.js b/app/assets/javascripts/index/browse.js index 3ebe9531d..a47dd348e 100644 --- a/app/assets/javascripts/index/browse.js +++ b/app/assets/javascripts/index/browse.js @@ -36,7 +36,7 @@ function initializeBrowse(map) { map.on('layerremove', function (e) { if (e.layer === dataLayer) { map.off("moveend", updateData); - clearStatus(); + $('#browse_status').empty(); } }); @@ -51,9 +51,7 @@ function initializeBrowse(map) { } function displayFeatureWarning(count, limit, callback) { - clearStatus(); - - $('#browse_status').append( + $('#browse_status').html( $("

") .text(I18n.t("browse.start_rjs.loaded_an_area_with_num_features", { num_features: count, max_features: limit })) .append( @@ -69,12 +67,12 @@ function initializeBrowse(map) { var size = bounds.getSize(); if (size > OSM.MAX_REQUEST_AREA) { - setStatus(I18n.t("browse.start_rjs.unable_to_load_size", { max_bbox_size: OSM.MAX_REQUEST_AREA, bbox_size: size })); + $('#browse_status').html( + $("

") + .text(I18n.t("browse.start_rjs.unable_to_load_size", { max_bbox_size: OSM.MAX_REQUEST_AREA, bbox_size: size }))); return; } - setStatus(I18n.t('browse.start_rjs.loading')); - var url = "/api/" + OSM.API_VERSION + "/map?bbox=" + bounds.toBBoxString(); /* @@ -103,7 +101,7 @@ function initializeBrowse(map) { var features = dataLayer.buildFeatures(xml); function addFeatures() { - clearStatus(); + $('#browse_status').empty(); dataLayer.addData(features); } @@ -133,14 +131,4 @@ function initializeBrowse(map) { // Stash the currently drawn feature selectedLayer = layer; } - - function setStatus(status) { - if($('#browse_status').is(':empty')) { - $('#browse_status').append($('

').text(status)); - } - } - - function clearStatus() { - $('#browse_status').empty(); - } }