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
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
3 changed files with 13 additions and 3 deletions

View File

@ -14,6 +14,11 @@
<span>{{ $parent.layoutVm.currentUsername }}</span>
</a>
</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>
<a href="http://docs.ansible.com/ansible-tower/" target="_blank">
<i class="fa fa-book" alt="{{ $parent.layoutVm.getString('VIEW_DOCS') }}"></i>

View File

@ -1,5 +1,5 @@
export default ['$rootScope', '$scope', '$state', 'ConfigService',
($rootScope, $scope, $state, ConfigService) => {
export default ['$rootScope', '$scope', '$location', 'ConfigService', 'lastPath',
($rootScope, $scope, $location, ConfigService, lastPath) => {
ConfigService.getConfig()
.then(function(config){
@ -10,7 +10,7 @@ export default ['$rootScope', '$scope', '$state', 'ConfigService',
$('#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) {
let text = `${brand} ${version}`;

View File

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