Skip to content

Commit

Permalink
[Fix][xs]: Map expand and clear improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
sagargg committed May 20, 2024
1 parent 89077b0 commit da4db88
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
14 changes: 14 additions & 0 deletions ckanext/rvr/assets/css/rvr.css
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,17 @@ div#dataset-map-attribution div a{
background-color: #c8e9e842;
}

.spatial-map-clear {
position: absolute;
z-index: 1;
right: 40px;
top: 4px;
color: #888888;
font-size: 12px;
line-height: 20px;
text-decoration: underline;
}


.dataset-map-expanded #dataset-map {
height: 412px !important;
Expand Down Expand Up @@ -964,6 +975,9 @@ div#dataset-map-container.map-draw-field {
}


#dataset-map {
position: relative;
}

.dataset-map-expanded #dataset-map {
position: absolute;
Expand Down
12 changes: 10 additions & 2 deletions ckanext/rvr/assets/js/rvrSpatialQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,23 @@ this.ckan.module('rvr-spatial-query', function ($, _) {

// OK add the expander
$('a.leaflet-draw-draw-rectangle', module.el).on('click', function(e) {
e.preventDefault();

if (!is_exanded) {
$('body').addClass('dataset-map-expanded');
if (should_zoom && !extentLayer) {

if (should_zoom && !extentLayer && map) {
map.zoomIn();
}
resetMap();

if (typeof resetMap === "function") {
resetMap();
}

is_exanded = true;
}
});

var buttonsHtml = [
'<div id="dataset-map-edit-buttons">',
'<a href="javascript:;" class="btn cancel">'+ this._('Cancel')+ '</a> ',
Expand Down
2 changes: 1 addition & 1 deletion ckanext/rvr/templates/spatial/spatial_query.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

#}
<section id="dataset-map" class="module module-narrow module-shallow">
<a href="{{ h.remove_url_param(['ext_bbox']) }}" class="action spatial-map-clear">{{ _('Clear') }}</a>
<h2 class="module-heading" data-bs-toggle="collapse" data-module="collapse-arrow" data-bs-target="#collapse-dataset-map" aria-expanded="true" aria-controls="collapse-dataset-map">
<span class="fa fa-chevron-up collapse-arrow"></span>
<i class="fa fa-globe"></i>
{{ _('Filter this by location') }}
<a href="{{ h.remove_url_param(['ext_bbox']) }}" class="action">{{ _('Clear') }}</a>
<p class="module-subheading">{{ _('Mit Klick auf den Stift Filterbereich festlegen.') }} </p>
</h2>
{% set map_config = h.get_common_map_config() %}
Expand Down

0 comments on commit da4db88

Please sign in to comment.