From cbad565f0e90c1d8ef47eac71b0026e96acc482c Mon Sep 17 00:00:00 2001 From: juanmont Date: Tue, 27 Feb 2018 18:30:23 +0100 Subject: [PATCH] F #1271: Added possibility to use the utility without resource (#1803) --- src/sunstone/public/app/utils/status.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/app/utils/status.js b/src/sunstone/public/app/utils/status.js index d6534b8496..f4715a657c 100644 --- a/src/sunstone/public/app/utils/status.js +++ b/src/sunstone/public/app/utils/status.js @@ -85,15 +85,19 @@ define(function(require) { FUNCTION DEFINITIONS */ - function _state_lock_to_color(resource,state,lock){ + function _state_lock_to_color(resource, state, lock, set_color){ var color = "transparent"; var show_lock = ""; - if (state && resource in resource_states){ - var available_states = resource_states[resource]; - if (state in available_states){ - color = available_states[state]; + if ( set_color == undefined ) { + if (state && resource in resource_states){ + var available_states = resource_states[resource]; + if (state in available_states){ + color = available_states[state]; + } } + } else { + color = set_color; } if (lock){