From 0c0017bb9805ba08a83bb4a8cee48e12302cf349 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 20 Feb 2012 22:27:47 +0530 Subject: [PATCH] indicate whether stop has_point --- chaloBEST/static/css/editstops.css | 8 ++++++++ chaloBEST/static/js/editstops.js | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/chaloBEST/static/css/editstops.css b/chaloBEST/static/css/editstops.css index f69bc7c..d011a9b 100644 --- a/chaloBEST/static/css/editstops.css +++ b/chaloBEST/static/css/editstops.css @@ -51,3 +51,11 @@ html, body { .clear { clear: both; } + +.has_point { + color: #222; +} + +.no_has_point { + color: #666; +} diff --git a/chaloBEST/static/js/editstops.js b/chaloBEST/static/js/editstops.js index 87db24d..cfecb5b 100644 --- a/chaloBEST/static/js/editstops.js +++ b/chaloBEST/static/js/editstops.js @@ -94,6 +94,7 @@ function getStopsList(stops) { var props = v.properties; var geom = v.geometry; var $li = $('
  • ').addClass("stopItem").data("slug", props.slug).data("properties", props).data("geometry", geom).text(props.display_name).appendTo($ul); + isEmpty(geom) ? $li.addClass("no_has_point") : $li.addClass("has_point"); }); return $ul; } @@ -106,3 +107,7 @@ function getStopForm(stop) { // var $form = $('
    ').apendTo($div); return $div; } + +function isEmpty(obj) { + return ($.toJSON(obj) == "{}") +}