Class ZmAppViewMgr
In general, the app view manager responds to changes in the skin by having each of the affected components adapt to its container's new location and/or size. That means that we are dependent on the browser to relocate and resize the containers within the skin properly. The top and bottom toolbars and the app content are treated somewhat differently: they come under the purview of "app view management". In general, an application represents a view with a toolbar and a content area (which is often a list view). App view management allows these views to be pushed and popped as if they were in a stack. That way, the views only need be constructed once each. The app view components are hidden and shown using two methods: z-index and relocation. Since every component hangs off the shell, it must have a z-index of at least Z_VIEW (300) to be visible. It can be hidden by setting its z-index to Z_HIDDEN (100). Since both IE and Firefox have display bugs related to the use of z-index, we use relocation as well: a hidden component is positioned way off the screen. (In IE, SELECT fields don't obey z-index, and in Firefox, the cursor bleeds through.) Note: the above was true in 2005, and we haven't rewritten the app view manager substantially since then. Some day we may just append the elements to their parent containers within the DOM, but until then we'll do absolute positioning. A view can open in a tab (in the row of app buttons) rather than replacing the current view. Those are handled in essentially the same way (view push and pop), but they also manage the app button. We currently manage only a single view in a tab. Defined in: ZmAppViewMgr.js.
Class Detail
ZmAppViewMgr(shell, controller, isNewWindow, hasSkin)
Creates a layout manager from the given components.
Author: Conrad Damon.
Method Detail
createView(params)
Registers a set of elements comprising an app view.
displayComponent(cid, show, doFit, comp, noReflow)
Handles several tasks needed to make sure a component is actually visible.
fitAll()
Fits all components to the container.
{string}
getAppView(app)
Gets the current top-level view for the given app.
getContainer(cid, comp)
Returns the requested container.
{Object}
getCurrentView(view)
Gets the main content object of the given view.
{string}
getCurrentViewId()
Gets the ID of the view currently being displayed.
{string}
getCurrentViewType()
Gets the type of the view currently being displayed.
{Object}
getLastViewId()
Gets the ID of the app view last displayed.
{Object}
getPendingViewId()
Gets the currently pending view waiting to get pushed.
getViewComponent(cid, viewId)
Returns the requested component (widget) for the given view. The search is done
in the following order:
1. A component particular to that view
2. A component associated with the view's app
3. A global component
getViewsByType(type, visible)
Returns a list of views of the given type. The views are the anonymous view objects used by the app view mgr.
{Boolean}
isAppView(viewId)
Checks if the view is the app view.
{boolean}
isFullScreen(viewId)
Returns true if the view is full screen.
isHidden(cid, viewId)
Returns true if the given component should be hidden. Checks local, app, and then
global levels. At any level, the presence of a component trumps whether it is supposed
to be hidden.
{Boolean}
isOkToUnload()
Checks if it is OK to unload the app (for example, user logs out, navigates away, closes browser).
{boolean}
isVisible(viewId)
Returns true if the given view is visible to the user.
{Boolean}
popView(force, viewId, skipHistory)
Hides the currently visible view, and makes the view on top of the hidden stack visible.
{Boolean}
pushView(viewId, force)
Makes the given view visible, pushing the previously visible one to the top of the
hidden stack.
setAppView(app, viewId)
Sets the current top-level view for the given app. Should be called by an app (or controller) that
changes the top-level view of the app.
setHiddenComponents(viewId, cidList, hide, app)
Sets whether the given components should be hidden. That setting can appear at any
of three levels: global, app, or local.
setTabTitle(viewId, text)
Sets the tab title.
{Boolean}
setView(viewId, force)
Makes the given view visible, and clears the hidden stack.
setViewComponents(viewId, components, show, app)
Registers the given components with the app view manager, and optionally displays them.
showComponent(cid, show, comp)
Shows or hides the given component. It may still need to be positioned.
showPendingView(show)
Shows the view that was waiting for return from a popped view's callback. Typically, the
popped view's callback will have put up some sort of dialog, and this function would be
called by a listener on a dialog button.
showSkinElement(cid, show, noReflow)
Shows or hides the skin element (not always the same as the container) for a given
component.
stageView(viewId)
Moves the given view to the top of the hidden stack, so that it will
appear when the current view is popped.
updateTitle()
Updates and shows the current view title in the title bar.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:35 GMT-0400 (EDT)
|