The overlay manager includes the following and non-exhaustive list of responsibilities:
- Instantiate and initialize the Granite.author.Overlays
- Influence all the Granite.author.Overlays at once
- Position all the the Granite.author.Overlays at once
Overlays are created out of the Granite.author.Editables (which are stored in Granite.author.editables)
This Granite.author.ui.Overlays are visual interfaces between the user and the underlying content
The overlay manager broadcasts cq-overlay-* events informing a given user interaction (hover, click, etc.) occurred on an overlay
Other modules could then listen to those events; like for instance Granite.author.selection
- Source:
- overlayManager.js
Methods
-
create(editable)
-
Creates an Granite.author.ui.Overlay for the given Granite.author.Editable (if not already existing)
This process is executed for the current Granite.author.Editable instance but also recursively through its parents and children
Recursive
Parameters:
Name Type Description editable
Granite.author.Editable Granite.author.Editable for which to create a series of Granite.author.ui.Overlay's among
its parents and children. The overlay instance is also associated to its Granite.author.Editable instance- Source:
- overlayManager.js
-
createAll()
-
Recreates or creates the Granite.author.ui.Overlays for the given Granite.author.Editables
Parameters:
Name Type Description cfg.editables
Array.<Granite.author.Editable> The editables for which to create an Granite.author.ui.Overlay
- Source:
- overlayManager.js
-
destroy(editable)
-
Destroys the Granite.author.ui.Overlay of the given Granite.author.Editable and its children Granite.author.ui.Overlays
Recursive
Parameters:
Name Type Description editable
Granite.author.Editable Granite.author.Editable to be destroy. This also includes its children
- Source:
- overlayManager.js
-
getOverlayRendering()
-
Returns the currently used Overlay constructor
- Source:
- overlayManager.js
-
recreate(editable)
-
Recreates or creates an Granite.author.ui.Overlay for the given Granite.author.Editable
Recursive
Parameters:
Name Type Description editable
Granite.author.Editable Granite.author.Editable for which to recreate an Granite.author.ui.Overlay
- Source:
- overlayManager.js
-
reposition()
-
Repositions all the Granite.author.ui.Overlays
- Source:
- overlayManager.js
Fires:
Returns:
- Type
- $.Promise
-
resetOverlayRendering()
-
Resets the Overlay constructor to default (Granite.author.ui.Overlay)
- Source:
- overlayManager.js
-
setOverlayRendering(fn)
-
Sets a custom Overlay constructor
Parameters:
Name Type Description fn
function the Overlay constructor
- Source:
- overlayManager.js
-
setOverlaysVisible( [condition])
-
Shows or hides the overlays but not the container
Parameters:
Name Type Argument Description condition
boolean <optional>
Should the Granite.author.ui.Overlays be visible
- Source:
- overlayManager.js
-
setup()
-
Creates overlays out of the Granite.author.editables store.
This method requires the editables to be already loaded.
- Source:
- overlayManager.js
-
setVisible( [condition])
-
Shows or hides the main container (all overlays)
Parameters:
Name Type Argument Description condition
boolean <optional>
Should the Overlay (#ContentWrapper) container be visible
- Source:
- overlayManager.js
-
teardown()
-
Removes all overlays from the current Granite.author.editables store
- Source:
- overlayManager.js