You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
678 B
29 lines
678 B
export const NOT_VISIBLE = 0
|
|
export const VISIBLE = 2
|
|
|
|
/**
|
|
* @param {Boolean} visibility
|
|
*/
|
|
export function visibilityFromBoolean(visibility) {
|
|
return visibility ? VISIBLE : NOT_VISIBLE
|
|
}
|
|
|
|
/**
|
|
* @param {Number} visibilityProperty
|
|
*/
|
|
export function toggleVisibilityProperty(visibilityProperty) {
|
|
if (visibilityProperty === NOT_VISIBLE) {
|
|
return VISIBLE
|
|
} else if (visibilityProperty === VISIBLE) {
|
|
return NOT_VISIBLE
|
|
} else {
|
|
console.error(`Toggle visibility is not posible with value "${visibilityProperty}"`)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param {Number} visibilityProperty
|
|
*/
|
|
export function isVisible(visibilityProperty) {
|
|
return visibilityProperty === VISIBLE
|
|
}
|
|
|