diff --git a/client/src/index.html b/client/src/index.html index 2f3ba6f060..687659621a 100644 --- a/client/src/index.html +++ b/client/src/index.html @@ -59,10 +59,12 @@

{{AppCtrl.projectName}}

+ + + - - - diff --git a/client/src/partials/settings/settings.js b/client/src/partials/settings/settings.js index 811b9e9b9e..a688af3516 100644 --- a/client/src/partials/settings/settings.js +++ b/client/src/partials/settings/settings.js @@ -2,7 +2,7 @@ angular.module('bhima.controllers') .controller('settings', SettingsController); SettingsController.$inject = [ - '$http', '$routeParams', '$location', 'LanguageService', 'SessionService' + '$state', 'LanguageService', 'SessionService' ]; /** @@ -10,30 +10,25 @@ SettingsController.$inject = [ * * The settings page allows a user to control the local application settings, * such as display language. + * + * @constructor */ -function SettingsController($http, $routeParams, $location, Languages, Session) { +function SettingsController($state, Languages, Session) { var vm = this; // the url to return to (using the back button) - vm.url = $routeParams.url || ''; + vm.previous = $state.params.previous; // load settings from services vm.settings = { language : Languages.key }; + // bind methods/services to the view + vm.languageService = Languages; + vm.logout = Session.logout; + /** bind the language service for use in the view */ Languages.read() .then(function (languages) { vm.languages = languages; }); - - vm.languageService = Languages; - - /** returns a user to the previous url */ - vm.back = back; - - function back() { - $location.url(vm.url); - } - - vm.logout = Session.logout; }