Logo

What are you looking for?

Get help straight from our team...

API's, Frameworks & Databases

SK.VisibilityManager

Last updated on 13 Mar, 2023

 

Overview

The class Visibility Manager (SK.VisibilityManager) is managing visibility state of the given UI elements based on certain rules. These rules include properties to compare against certain values (match or no match), elements to show/hide. The rules apply on a properties hash (property:'value' pairs).

The configuration hash contains property rules, which is Array of Arrays (the rules). Each rule (Array) contains the following indexes:

  • property name

  • operator (== or !=)

  • values (Array of values to match operator)

  • selector (MooTools.Elements)

  • action ("show", "hide" or "sync" (executes "show" if match, otherwise executes "hide"), default "show")

The highest array index of a rule, the highest priority it has. If the action is "show" or "hide", VisibilityManager will execute it only if there is a match. If it is equal to "sync" - a "show" action is performed if there's a match, otherwise "hide" is executed.

 

Include Resource Files

Please note, the file dependencies might be included in the environment.

  • /Shared/Scripts/visibility_manager.js

      <script type="text/javascript" src="/Shared/Scripts/visibility_manager.js"></script>

 

Default Options

Name

Description

Type

Default Value

properties

Initial set of properties ( {property: 'value'} ).

Object

null

configuration

Groups of UIs which visible state should be changed depending on the properties.

Object

{ rules : [] }

 

Methods

Name

Description

Parameters

Returns

getProperties

Returns an object with the properties.

-

Object (current set of properties)

setProperties

Sets new properties to compare.

Object (new set of properties)

-

refresh

Performes property comparison based on the rules in the configuration. As a result, updates elements' visibility state.

Object (new set of properties)

-

 

Examples

  • Creating new instance of Visibility Manager:

Did you find this article helpful?
Previous

SK.Applications.Settings

Next