From 9a26ce60cf6709acbd83c0b5665b148d3187aa97 Mon Sep 17 00:00:00 2001 From: etienne Date: Sun, 16 Aug 2009 17:02:25 +0000 Subject: Show/hide subcategories - #47 git-svn-id: http://www.peacefrogs.net/svn/chimere/trunk@33 9215b0d5-fb2c-4bbd-8d3e-bd2e9090e864 --- static/icons/minus.png | Bin 0 -> 259 bytes static/icons/plus.png | Bin 0 -> 275 bytes static/main_map.js | 20 ++++++++++++++++++++ static/styles.css | 5 +++++ 4 files changed, 25 insertions(+) create mode 100644 static/icons/minus.png create mode 100644 static/icons/plus.png (limited to 'static') diff --git a/static/icons/minus.png b/static/icons/minus.png new file mode 100644 index 0000000..a95822f Binary files /dev/null and b/static/icons/minus.png differ diff --git a/static/icons/plus.png b/static/icons/plus.png new file mode 100644 index 0000000..404a24a Binary files /dev/null and b/static/icons/plus.png differ diff --git a/static/main_map.js b/static/main_map.js index 61f838a..145f936 100644 --- a/static/main_map.js +++ b/static/main_map.js @@ -18,6 +18,26 @@ See the file COPYING for details. /* main map */ +var current_cat; + +/* open a category section */ +function toggleCategory(id){ + old = document.getElementById('maincategory_' + current_cat) + if(old){ + old.style.display = 'None'; + old_img = document.getElementById('maincategory_img_' + current_cat); + old_img.src = "/" + extra_url + "static/icons/plus.png"; + } + if (id != current_cat){ + current_cat = id; + document.getElementById('maincategory_' + current_cat).style.display = 'block'; + img = document.getElementById('maincategory_img_' + current_cat); + img.src = "/" + extra_url + "static/icons/minus.png"; + } else { + current_cat = 0; + } +} + /* check all the categories if clicked, unckeck if unclick */ function checkAll(item, ids){ check = false; diff --git a/static/styles.css b/static/styles.css index 45b9b71..df08ee3 100644 --- a/static/styles.css +++ b/static/styles.css @@ -258,6 +258,11 @@ color:purple; cursor:pointer; } +.control_image{ +cursor:pointer; +vertical-align:text-bottom; +} + .errorlist{ color:purple; font-weight:bold; -- cgit v1.2.3