Package org.opencms.gwt.client
Class CmsMediaQueryRuleManager
java.lang.Object
org.opencms.gwt.client.CmsMediaQueryRuleManager
Singleton class that evaluates, and keeps track of changes for, a fixed set of media queries and sets CSS classes
on the body element depending on which of the media queries match.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Installs a new media query rule.static CmsMediaQueryRuleManager
get()
Gets the instance.static void
Initializes the manager and sets up the rules.void
updateBodyClass
(String cssClass, boolean enabled) Adds or removes a CSS class from the body.
-
Field Details
-
instance
The instance.
-
-
Constructor Details
-
CmsMediaQueryRuleManager
protected CmsMediaQueryRuleManager()Initializes the rules.
-
-
Method Details
-
get
Gets the instance.- Returns:
- the instance
-
initialize
Initializes the manager and sets up the rules. -
addRule
Installs a new media query rule.- Parameters:
cssClass
- the CSS class to add if the media query matchesmediaQueryText
- the text of the media query
-
updateBodyClass
Adds or removes a CSS class from the body.- Parameters:
cssClass
- the CSS classenabled
- true if the class should be added, false to remove it
-