Move about modal to top navigation bar

This commit is contained in:
Marliana Lara
2018-07-19 10:59:33 -04:00
parent bc3f06c725
commit 1ff4d50cc6
3 changed files with 13 additions and 3 deletions

View File

@@ -14,6 +14,11 @@
<span>{{ $parent.layoutVm.currentUsername }}</span> <span>{{ $parent.layoutVm.currentUsername }}</span>
</a> </a>
</at-top-nav-item> </at-top-nav-item>
<at-top-nav-item>
<a ui-sref="about">
<i class="fa fa-info" alt="{{ vm.getString('FOOTER_ABOUT') }}"></i>
</a>
</at-top-nav-item>
<at-top-nav-item> <at-top-nav-item>
<a href="http://docs.ansible.com/ansible-tower/" target="_blank"> <a href="http://docs.ansible.com/ansible-tower/" target="_blank">
<i class="fa fa-book" alt="{{ $parent.layoutVm.getString('VIEW_DOCS') }}"></i> <i class="fa fa-book" alt="{{ $parent.layoutVm.getString('VIEW_DOCS') }}"></i>

View File

@@ -1,5 +1,5 @@
export default ['$rootScope', '$scope', '$state', 'ConfigService', export default ['$rootScope', '$scope', '$location', 'ConfigService', 'lastPath',
($rootScope, $scope, $state, ConfigService) => { ($rootScope, $scope, $location, ConfigService, lastPath) => {
ConfigService.getConfig() ConfigService.getConfig()
.then(function(config){ .then(function(config){
@@ -10,7 +10,7 @@ export default ['$rootScope', '$scope', '$state', 'ConfigService',
$('#about-modal').modal('show'); $('#about-modal').modal('show');
}); });
$('#about-modal').on('hidden.bs.modal', () => $state.go('dashboard')); $('#about-modal').on('hidden.bs.modal', () => $location.url(lastPath));
function createSpeechBubble (brand, version) { function createSpeechBubble (brand, version) {
let text = `${brand} ${version}`; let text = `${brand} ${version}`;

View File

@@ -9,6 +9,11 @@ export default {
ncyBreadcrumb: { ncyBreadcrumb: {
label: N_("ABOUT") label: N_("ABOUT")
}, },
resolve: {
lastPath: function($location) {
return $location.url();
}
},
onExit: function(){ onExit: function(){
// hacky way to handle user browsing away via URL bar // hacky way to handle user browsing away via URL bar
$('.modal-backdrop').remove(); $('.modal-backdrop').remove();