Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Add back button #742

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
2.22.1 / 2020-02-07
===================

**Enhancements**

* Change back to map to previous page button in detail page

**Bug fixes**

* Fix some bugs after upgrade to Leaflet 1.x
Expand Down
5 changes: 5 additions & 0 deletions src/app/layout/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ function LayoutController($rootScope, $scope, $state, $location, resultsService,
}
};

//back button function called from back button's ng-click="back()"
$rootScope.previous = function previous () {
window.history.back();
};

rootScopeEvents.push(
$rootScope.$on('startSwitchGlobalLang', function () {
resultsService.getAllResults()
Expand Down
1 change: 1 addition & 0 deletions src/app/layout/styles/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@

.toolbar-action-label {
display: none;
.previous &,
.back-to-home & {
font-weight: bold;

Expand Down
6 changes: 3 additions & 3 deletions src/app/layout/templates/sidebar-detail.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ul class="toolbar-actions detail-actions category-{{::result.properties.category.id}}">
<li class="toolbar-action back-to-home">
<a class="toolbar-action-link" href ng-click="back()" tooltip-placement="right" tooltip="{{'BACK_TO_THE_MAP' | translate}}">
<li class="toolbar-action previous">
<a class="toolbar-action-link" href ng-click="previous()" tooltip-placement="right" tooltip="{{'BACK' | translate}}">
<ng-include class="stripe-icon svg-icon" src="'/images/icons/stripe.svg'"></ng-include>
<span class="toolbar-action-label">{{'BACK_TO_THE_MAP' | translate}}</span>
<span class="toolbar-action-label">{{'BACK' | translate}}</span>
</a>
</li>
<li class="toolbar-action rep-3d" ng-if="result.properties.contentType === 'trek' && webGLisEnable">
Expand Down