mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-12 07:57:41 +00:00
GUAC-634: Allow default value for local properties. Use default values within client and root UI.
This commit is contained in:
@@ -72,7 +72,7 @@ function GuacamoleSessionState() {
|
||||
* Sets the given property to the given value.
|
||||
*
|
||||
* @param {String} name The name of the property to change.
|
||||
* @param value An arbitrary value.
|
||||
* @param [value] An arbitrary value.
|
||||
*/
|
||||
this.setProperty = function(name, value) {
|
||||
state[name] = value;
|
||||
@@ -83,10 +83,16 @@ function GuacamoleSessionState() {
|
||||
* Returns the value stored under the property having the given name.
|
||||
*
|
||||
* @param {String} name The name of the property to read.
|
||||
* @param value The default value, if any.
|
||||
* @return The value of the given property.
|
||||
*/
|
||||
this.getProperty = function(name) {
|
||||
return state[name];
|
||||
this.getProperty = function(name, value) {
|
||||
|
||||
var current = state[name];
|
||||
if (current === undefined)
|
||||
return value;
|
||||
|
||||
return current;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user