diff options
-rw-r--r-- | chimere/models.py | 2 | ||||
-rw-r--r-- | chimere/static/chimere/js/jquery.chimere.js | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/chimere/models.py b/chimere/models.py index 5fc946c..3e877ed 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -2076,7 +2076,7 @@ class Area(models.Model, SimpleArea): restrict_to_extent = models.BooleanField(_("Restrict to the area extent"), default=False) single_click_map = models.BooleanField( - _("Mobile - Hide categories after click"), default=False) + _("Hide categories after click"), default=False) min_zoom = models.IntegerField( _("Minimum zoom"), blank=True, null=True, help_text=_("Set a minimal zoom level. By default minimal zoom level " diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index cb030e7..9075c94 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -1836,6 +1836,7 @@ function transformCoordToLonLat(coord) { $('.subcategories li input').bind("click", function (e) { $('#search-result').html(''); var c_name = $(this).attr('name'); + var c_id = $(this).attr('id'); c_name = c_name.substr(c_name.lastIndexOf("_") + 1); var par = $(this).parent(); if ($(this).prop('checked')){ @@ -1843,6 +1844,14 @@ function transformCoordToLonLat(coord) { } else { par.removeClass('selected'); } + if (settings[map_id].single_click_category){ + $('.subcategories li input').each(function(){ + if ($(this).attr('id') != c_id){ + $(this).prop('checked', false); + $(this).parent().removeClass('selected'); + } + }); + } if (!settings[map_id].suspend_load) methods.loadGeoObjects(map_id); _toggle_categories($(this)); if ($('#layer_cat_'+c_name).length){ |