Skip to content

Commit 051a38f

Browse files
author
Maxime Béguin
committed
Correct logo link on touch devices to navigate to home page and close menu
On touch devices, AngularJS directive does not work with href attribute (angular/angular.js#5307). Thus clicking on the logo was closing the menu but wasn't navigating to the home page. Also profile link was navigating to the profile page but not closing the menu.
1 parent c39e426 commit 051a38f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/client/admin/js/ov/MainController.js

+7
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
$scope.isResponsiveMenuClosed = false;
101101
};
102102

103+
$scope.navigate = function(event) {
104+
if (event) {
105+
$scope.closeResponsiveMenu();
106+
$location.path(angular.element(event.currentTarget).attr('href'));
107+
}
108+
};
109+
103110
/**
104111
* Changes the language to the given one.
105112
* This will reload the page due to the main menu which can't be

app/client/admin/views/root.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</div>
3434

3535
<!-- Logo -->
36-
<a class="navbar-brand" href="/be" ng-click="closeResponsiveMenu();">
36+
<a class="navbar-brand" href="/be" ng-click="navigate($event)">
3737
<img alt="OpenVeo" src="images/logo-white.png">
3838
</a>
3939
<!-- /logo -->
@@ -42,7 +42,7 @@
4242
<!-- Top Right Menu -->
4343
<ul class="nav navbar-nav navbar-right ">
4444
<li popover-title="{{'MENU.PROFILES' | translate}}" popover="{{userInfo.name}}" popover-trigger="mouseenter click" popover-placement="bottom">
45-
<a class="icon" href="profile" >
45+
<a class="icon" href="profile" ng-click="navigate($event)">
4646
<div class="glyphicon glyphicon-user"></div>
4747
</a>
4848
</li>

0 commit comments

Comments
 (0)