Mojo.Controller.StageController
This class provides methods to manipulate scene on the stage. A stage is an HTML structure very similar to a standard browser window. A single application may have multiple stages and a single stage may contain multiple scenes.
| Method Name and Description |
|---|
|
Mojo.Controller.StageController.activate()
|
|
Mojo.Controller.StageController.activeScene()
|
|
Mojo.Controller.StageController.deactivate()
|
|
Mojo.Controller.StageController.delegateToSceneAssistant(functionName)
|
|
Mojo.Controller.StageController.getAppController()
|
|
Mojo.Controller.StageController.getScenes()
|
|
Mojo.Controller.StageController.getWindowOrientation(orientation)
|
|
Mojo.Controller.StageController.hasNewContent()
|
|
Mojo.Controller.StageController.indicateNewContent(hasNew)
|
|
Mojo.Controller.StageController.isActiveAndHasScenes()
|
|
Mojo.Controller.StageController.isChildWindow()
|
|
Mojo.Controller.StageController.loadStylesheet(path)
|
|
Mojo.Controller.StageController.parentSceneAssistant(targetSceneAssistant)
|
|
Mojo.Controller.StageController.popScene(returnValue, options)
|
|
Mojo.Controller.StageController.popScenesTo(targetScene, returnValue, options)
|
|
Mojo.Controller.StageController.pushCommander(cmdr)
|
|
Mojo.Controller.StageController.pushScene(sceneArguments)
|
|
Mojo.Controller.StageController.removeCommander(cmdr)
|
|
Mojo.Controller.StageController.sendEventToCommanders(event)
|
|
Mojo.Controller.StageController.setClipboard(escapeHTML:, escapeHTML)
|
|
Mojo.Controller.StageController.setWindowOrientation(orientation)
|
|
Mojo.Controller.StageController.setWindowProperties(props)
|
|
Mojo.Controller.StageController.swapScene(sceneArguments)
|
|
Mojo.Controller.StageController.topScene()
|
|
Mojo.Controller.StageController.unloadStylesheet(path)
|
Programatically activate this stage. Causes card windows to be maximized.
Return the currently active scene from this stage, if any. If no scenes are active, returns undefined.
Programatically deactivate this stage. Causes card windows to be minimized.
Use to call a method on the assistant of the current scene of this stage. The first parameter is the name of the property that contains the function to call. The remaining parameters are passed to that function. The this keyword is bound to the scene assistant for this call.
- Parameters:
- {Object} functionName
- name of property to use to get the function to call.
Return the current application controller.
Returns an array of scene controllers currently on the stack. result[0] is the bottom scene on the stack.
Gets the orientation of the stage's window.
- Parameters:
- {String} orientation
- One of 'up', 'down', 'left' or 'right'
- Returns:
- {Boolean} returns true if the current stage has new content for the indicator, and false otherwise.
Makes the core navi button pulsate if true. This is mainly intended to alert the user to dashboard events that desire user attention.
- Parameters:
- hasNew
Returns true if the stage is both active and has currently pushed.
Utility function to find out if the current window is a child window.
- Returns:
- {Boolean} true for child windows.
Loads a stylesheet -- and any versions of it for the current locale -- into the stage's document.
- Parameters:
- {String} path
- A path relative to the application's root directory specifying the stylesheet to load.
Returns the scene assistant of the scene above this scene in the scene stack, or undefined if there is no such scene.
- Parameters:
- targetSceneAssistant
Removes a scene from the scene stack, passing the return value to the newly revealed scene's activate method. Note that this is an asynchronous operation.
- Parameters:
- {Object} returnValue
- Value passed to the next scene active method
- options
Removes scenes from the scene stack until the target scene is reached, or there are no scenes remaining on the stack. targetScene may be either the SceneController for the desired scene, the scene DOM ID, or the scene name. If targetScene is undefined, all scenes will be popped. Intermediate popped scenes are not reactivated, nor is there any visual transition to signify their removal from the stack. Note that this is an asynchronous operation.
- Parameters:
- {Object} targetScene
- returnValue
- options
Adds the given commander to the top of this StageController's stack. The commanders in this stack are only used when this scene is the current scene.
- Parameters:
- {Object} cmdr
Push a new scene; the Scene Lifecycle initial setup includes this function.
Note that this is an asynchronous operation.
An app calls stageController.pushScene('myScene'):
- A div is created with the view HTML for the new scene, and inserted into the
<body>. - A SceneController for 'myScene' is instantiated.
- A scene assistant for 'myScene' is instantiated, if available.
- The new scene is placed on the stage's scene stack then the Scene Controller and
assistant's
setup()methods are called and Widgets (divs that specify x-mojo-element) are created, rendered, and added to the DOM.
At this point, scene should now be ready for initial display, even if the app is waiting for a service request to complete to provide dynamic data to fill out the scene.
- The StageController transitions the scene onto the stage.
- When the transition is complete, the scene controller and assistant's
activatemethod is called, and the scene is ready for action.
- Parameters:
- {String|Object} sceneArguments
- either the name of the scene to push, or an object with properties including the name of the scene and the id to use as a DOM id. Note that all additional arguments are passed to the constructor of the next scene's assistant.
Removes a commander from the commander stack.
- Parameters:
- {Object} cmdr
- commander to remove.
Sends the given event through the entire command chain, starting with the CommanderStack in the current scene, and progressing to the StageController's stack if the current scene does not call event.stopPropagation().
- Parameters:
- {Object} event
This allows the client application to send text to the clipboard to be pasted elsewhere later.
- Parameters:
- {Boolean} escapeHTML:
- ignored in initial setClipboard api; later will allow pasting of rich text
- escapeHTML
Sets the orientation of the stage's window.
- Parameters:
- {String} orientation
- One of 'up', 'down', 'left', 'right', or 'free'
Change properties of the window.
- Parameters:
- {Object} props
- A map representing the properties to change. Keys are the property names, and values are the new values.
Possible values include:
blockScreenTimeout Boolean. If true, the screen will not dim or turn off in the absence of user activity. If false, the timeout behavior will be reinstated. setSubtleLightbar Boolean. If true, the light bar will be made somewhat dimmer than normal. If false, it will return to normal.
Pops the current scene and simultaneously pushed a new scene without activating & deactivating any underlying scenes. Note that this is an asynchronous operation.
- Parameters:
- {String|Object} sceneArguments
- either the name of the scene to push, or an object with properties including the name of the scene and the id to use as a DOM id.
Return the topmost scene from this stage.
Unloads a stylesheet -- and any versions of it for the current locale -- from the stage's document.
- Parameters:
- {String} path
- A path relative to the application's root directory specifying the stylesheet to unload.