summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/static/chimere/js/jquery.chimere.js5
-rw-r--r--chimere/templates/chimere/blocks/map_params.html2
2 files changed, 5 insertions, 2 deletions
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js
index d831b31..4c35fdf 100644
--- a/chimere/static/chimere/js/jquery.chimere.js
+++ b/chimere/static/chimere/js/jquery.chimere.js
@@ -255,7 +255,6 @@ See the file COPYING for details.
var val = category_element.is(":checked") ? true : false;
category_element.parent().find("li input").attr("checked", val);
}
- var _toggle_categories = function (category_element) {}
var _toggle_categories = function (subcategory_element) {
var parent = subcategory_element.parent().parent().parent();
var master_check = parent.find("> input");
@@ -265,6 +264,7 @@ See the file COPYING for details.
} else {
master_check.removeAttr('checked');
}
+ return master_check;
};
var _init_categories = function () {
/*
@@ -291,6 +291,9 @@ See the file COPYING for details.
if (settings.checked_categories.indexOf(parseInt(cat_id)) != -1) {
$(this).attr("checked", "checked");
_toggle_categories($(this));
+ methods.toggle_category();
+ } else {
+ $(this).attr("checked", false);
}
});
if (settings.display_submited == true){
diff --git a/chimere/templates/chimere/blocks/map_params.html b/chimere/templates/chimere/blocks/map_params.html
index d983a62..448e206 100644
--- a/chimere/templates/chimere/blocks/map_params.html
+++ b/chimere/templates/chimere/blocks/map_params.html
@@ -14,7 +14,7 @@
{{icon_offset_y}});
chimere_init_options["dynamic_categories"] = {{ dynamic_categories }};
{% if p_display_submited %}chimere_init_options["display_submited"] = {{ p_display_submited }};{% endif %}
- chimere_init_options["checked_categories"] = {% if p_checked_categories %}{{p_checked_categories}}{% else %} {{ CHIMERE_DEFAULT_CATEGORIES }}{% endif %};
+ chimere_init_options["checked_categories"] = {% if p_checked_categories %}[{{p_checked_categories}}]{% else %} {{ CHIMERE_DEFAULT_CATEGORIES }}{% endif %};
var p_current_feature{% if p_current_feature %} = {{ p_current_feature }}{% endif %};
</script>