Skip to content

Commit

Permalink
adds sidepanel toggles, re: #4670
Browse files Browse the repository at this point in the history
  • Loading branch information
robgaston committed Apr 25, 2019
1 parent 38aed98 commit 5e2aaee
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 8 deletions.
23 changes: 21 additions & 2 deletions arches/app/media/css/arches.css
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ input[type="checkbox"] {
height: 100%;
width: 92px;
background-color: rgb(247, 247, 247);
border-left: 1px solid rgb(216, 216, 216);
}

.map-card-sidebar-tab {
Expand All @@ -569,12 +570,30 @@ input[type="checkbox"] {
text-align: center;
font-size: 1.1em;
border-bottom: 1px solid rgb(216, 216, 216);
border-left: 1px solid rgb(216, 216, 216);
cursor: pointer;
}

.map-card-sidebar-tab.active {
background-color: white;
border-left: solid 1px white;
margin-left: -1px;
}

.map-card-sidebar-tab i {
font-size: 1.7em;
display: block;
padding-bottom: 4px;
padding-bottom: 6px;
}

.map-card-sidepanel {
position:absolute;
z-index: 10;
right: 92px;
height: 100%;
width: 400px;
background: white;
border-left: 1px solid rgb(216, 216, 216);
padding: 16px;
}

#map-settings {
Expand Down
1 change: 1 addition & 0 deletions arches/app/media/js/views/components/cards/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ define([
"glyphs": arches.mapboxGlyphs,
"layers": layers
};
this.activeTab = ko.observable();

CardComponentViewModel.apply(this, [params]);
},
Expand Down
40 changes: 34 additions & 6 deletions arches/app/templates/views/components/cards/map.htm
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,47 @@
{% block form %}
<div class="map-card-wrapper">
<div class="map-card-sidebar">
<div class="map-card-sidebar-tab">
<div class="map-card-sidebar-tab" data-bind="click: function() {
if (activeTab() === 'legend') {
activeTab(null);
} else {
activeTab('legend');
}
}, css: {
'active': activeTab() === 'legend'
}">
<i class="fa fa-list-alt"></i>
Legend
{% trans "Legend" %}
</div>
<div class="map-card-sidebar-tab">
<div class="map-card-sidebar-tab" data-bind="click: function() {
if (activeTab() === 'basemap') {
activeTab(null);
} else {
activeTab('basemap');
}
}, css: {
'active': activeTab() === 'basemap'
}">
<i class="fa fa-globe"></i>
Basemap
{% trans "Basemap" %}
</div>
<div class="map-card-sidebar-tab">
<div class="map-card-sidebar-tab" data-bind="click: function() {
if (activeTab() === 'overlays') {
activeTab(null);
} else {
activeTab('overlays');
}
}, css: {
'active': activeTab() === 'overlays'
}">
<i class="fa fa-list"></i>
Overlays
{% trans "Overlays" %}
</div>
</div>
<!--ko if: activeTab() -->
<div class="map-card-sidepanel" data-bind="text: activeTab">
</div>
<!--/ko -->
<div class="map-card-container" data-bind="mapboxgl: {
mapOptions: { style: mapStyle }
}">
Expand Down

0 comments on commit 5e2aaee

Please sign in to comment.