Constructor
new Preview(container, presentation, selection, viewport, controller)
Initialize a new preview area.
This method registers the event handlers for the preview area of the presentation editor.
Parameters:
Name | Type | Description |
---|---|---|
container |
HTMLElement | The HTML element that will contain this preview area. |
presentation |
module:model/Presentation.Presentation | The current Sozi presentation. |
selection |
module:model/Selection.Selection | The object that manages the frame and layer selection. |
viewport |
module:player/Viewport.Viewport | The viewport where the presentation is displayed. |
controller |
module:Controller.Controller | The controller that manages the current editor. |
- Source:
Members
container :HTMLElement
The HTML element that will contain this preview area.
Type:
- HTMLElement
- Source:
controller :module:Controller.Controller
The controller that manages the current editor.
Type:
- Source:
presentation :module:model/Presentation.Presentation
The current Sozi presentation.
Type:
- Source:
selection :module:model/Selection.Selection
The object that manages the frame and layer selection.
Type:
- Source:
viewport :module:player/Viewport.Viewport
The viewport where the presentation is displayed.
Type:
- Source:
Methods
onClick(button, evt)
Choose an outline element on an Alt+click event in this preview area.
Parameters:
Name | Type | Description |
---|---|---|
button |
number | The mouse button number that was clicked. |
evt |
MouseEvent | A DOM event. |
- Source:
Listens to Events:
- event:click
onLoad()
Reset the preview area when a presentation is loaded or reloaded.
- Source:
Listens to Events:
onMouseEnter()
When the mouse hovers the preview area, reveal the clipping rectangle.
Listens to Events:
- event:mouseenter
onMouseLeave()
When the mouse leaves the preview area, conceal the clipping rectangle.
Listens to Events:
- event:mouseleave
repaint()
Refresh this preview area on resize and repaint events.
This method will update the geometry of the preview area, realign all cameras and repaint the viewport.
- Source:
- See:
Listens to Events:
- event:resize
- module:Controller.event:repaint