summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/static/chimere/css/styles.css15
-rw-r--r--chimere/static/chimere/js/jquery.chimere.js9
-rw-r--r--chimere/templates/chimere/blocks/categories.html33
3 files changed, 43 insertions, 14 deletions
diff --git a/chimere/static/chimere/css/styles.css b/chimere/static/chimere/css/styles.css
index d7542d3..0649d3a 100644
--- a/chimere/static/chimere/css/styles.css
+++ b/chimere/static/chimere/css/styles.css
@@ -682,6 +682,10 @@ span.icon{
vertical-align: bottom;
}
+#categories label{
+ white-space: nowrap;
+}
+
#categories > ul{
margin:0;
padding:0 10px;
@@ -1913,3 +1917,14 @@ span#permalink, .navbar-nav .lbl, #areas-div label, #permalink, #simple_button,
transform: scale(0.75, 0.75);
display: none;
}
+
+.description_icon{
+ position: absolute;
+ right: 5px;
+ padding: 3px;
+ background-color: white;
+ border: 1px solid #999;
+ border-radius: 5px;
+ margin-top: 3px;
+ display: none;
+}
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js
index 61629b9..65c8819 100644
--- a/chimere/static/chimere/js/jquery.chimere.js
+++ b/chimere/static/chimere/js/jquery.chimere.js
@@ -1802,9 +1802,6 @@ function transformCoordToLonLat(coord) {
$('#search-result').html('');
var c_name = $(this).attr('name');
c_name = c_name.substr(c_name.lastIndexOf("_")+1);
- if($(this).is(':checked')){
- methods.subcategory_detail(c_name);
- }
var par = $(this).parent();
if ($(this).prop('checked')){
par.addClass('selected');
@@ -3083,11 +3080,11 @@ function transformCoordToLonLat(coord) {
helpers.zoom_to_area(map_id, options["area"]);
}
},
- open_dialog: function(title, content){
- if(settings[map_id].open_dialog_fx){
+ open_dialog: function(title, content, map_id){
+ if(map_id && settings[map_id].open_dialog_fx){
settings[map_id].open_dialog_fx(title, content);
} else {
- $('#category_description .modal-body').html(message);
+ $('#category_description .modal-body').html(content);
$('#category_description .modal-title').html(title);
$('#category_description').modal("show");
}
diff --git a/chimere/templates/chimere/blocks/categories.html b/chimere/templates/chimere/blocks/categories.html
index 629bd3e..656504c 100644
--- a/chimere/templates/chimere/blocks/categories.html
+++ b/chimere/templates/chimere/blocks/categories.html
@@ -18,14 +18,18 @@
{% for sub_category in lst_sub_categories %}
<li id='li_sub_{{sub_category.id}}' class='subcategory'
data-subcategory="{{sub_category.id}}">
- <input type='checkbox' name='category_{{sub_category.id}}' id='category_{{sub_category.id}}'{% if sub_category.selected %} checked='checked'{% endif %}/>
- <label for='category_{{sub_category.id}}'>
- <span class='cat_image'><img alt='{{ sub_category.name }}' src='{{ MEDIA_URL }}{{sub_category.icon.image}}'/></span>
- {% trans sub_category.name %}
- </label>
- {% comment %}
- <span class="glyphicon glyphicon-zoom-in zoom_image zoom_to_subcategory" id="zoom_to_subcategory_{{sub_category.id}}"></span>
- {% endcomment %}
+ <span>
+ {% if sub_category.description %}
+ <a href="#"><i class="description_icon fa fa-info-circle"
+ aria-hidden="true"
+ onclick="$('#map').chimere('subcategory_detail', {{sub_category.id}});"></i>
+ </a>
+ {% endif %}
+ <label for='category_{{sub_category.id}}'>
+ {% trans sub_category.name %}
+ </label>
+ <input type='checkbox' name='category_{{sub_category.id}}' id='category_{{sub_category.id}}'{% if sub_category.selected %} checked='checked'{% endif %}/>
+ </span>
</li>
{% endfor %}
{% if category.description %}
@@ -35,3 +39,16 @@
</li>
{% endfor %}
</ul>
+
+<script type='text/javascript'>
+<!--
+$(function() {
+ $(".subcategory").mouseenter(function() {
+ $(this).find(".description_icon").show();
+ }).mouseleave(function() {
+ $(this).find(".description_icon").hide();
+ });
+
+});
+// -->
+</script>