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 TypeMethodDescriptionvoidInstalls a new media query rule.static CmsMediaQueryRuleManagerget()Gets the instance.static voidInitializes the manager and sets up the rules.voidupdateBodyClass(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
-