GUAC-1053: Add preference service, storing the default mouse emulation mode and input method.

This commit is contained in:
Michael Jumper
2015-04-19 21:17:26 -07:00
parent cbb5ab953c
commit 02ca2a4d7c
3 changed files with 114 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
var $location = $injector.get('$location');
var guacClientManager = $injector.get('guacClientManager');
var guacNotification = $injector.get('guacNotification');
var preferenceService = $injector.get('preferenceService');
var userPageService = $injector.get('userPageService');
/**
@@ -196,7 +197,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
*
* @type String
*/
inputMethod : 'none',
inputMethod : preferenceService.preferences.inputMethod,
/**
* The current scroll state of the menu.

View File

@@ -23,8 +23,11 @@
/**
* A service for generating new guacClient properties objects.
*/
angular.module('client').factory('ClientProperties', [function defineClientProperties() {
angular.module('client').factory('ClientProperties', ['$injector', function defineClientProperties($injector) {
// Required services
var preferenceService = $injector.get('preferenceService');
/**
* Object used for interacting with a guacClient directive.
*
@@ -81,7 +84,7 @@ angular.module('client').factory('ClientProperties', [function defineClientPrope
*
* @type Boolean
*/
this.emulateAbsoluteMouse = template.emulateAbsoluteMouse || true;
this.emulateAbsoluteMouse = template.emulateAbsoluteMouse || preferenceService.preferences.emulateAbsoluteMouse;
/**
* The relative Y coordinate of the scroll offset of the display within