From 92bc5a75863f03a3522d2af213d1eae71c977009 Mon Sep 17 00:00:00 2001 From: Athou Date: Thu, 4 Apr 2013 13:13:08 +0200 Subject: [PATCH] modify settings only when saving --- src/main/webapp/js/controllers.js | 6 +++- src/main/webapp/templates/settings.html | 42 +++++++++++++------------ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 58b4bbf2..69009dd5 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -346,6 +346,9 @@ module.controller('ManageUserCtrl', function($scope, $state, $stateParams, module.controller('SettingsCtrl', function($scope, $location, SettingsService) { $scope.settingsService = SettingsService; + $scope.$watch('settingsService.settings', function(value) { + $scope.settings = angular.copy(value); + }); $scope.codeMirrorConfig = { mode : 'css', lineNumbers : true @@ -356,8 +359,9 @@ module.controller('SettingsCtrl', function($scope, $location, SettingsService) { }); }; $scope.save = function() { + SettingsService.settings = $scope.settings; SettingsService.save(function() { - $location.path('/'); + window.location.href = window.location.href.substring(0, window.location.href.lastIndexOf('#')); }); }; }); \ No newline at end of file diff --git a/src/main/webapp/templates/settings.html b/src/main/webapp/templates/settings.html index 1e285510..16db3ac9 100644 --- a/src/main/webapp/templates/settings.html +++ b/src/main/webapp/templates/settings.html @@ -2,27 +2,29 @@ -
-
- -
-
-
-
- Placeholder for general settings -
-
- +
+
+
+ +
+
+
+
+ Placeholder for general settings +
+
+ +
-
-
- - -
+
+ + +
+
\ No newline at end of file