ui/viewmangager ================= .. js:class:: ViewManager(container, listenerTarget) :extends: UINodeCollection This window manager allows for multiple abitrary arranged :js:class:`MainView` by using :js:class:`Split` and :js:class:`Tabber`. :param JQuery container: The JQuery container DOM node in which all content will be rendered. :param Emitter listenerTarget: The Emitter whichi is watched for focus/blur and close events to take action upon. .. js:attribute:: scope read-only :type: String An UUID. This is internally needed to prevent the attached UINodes from escapeing when they are dragged around. .. js:attribute:: instances read-only :type: Array(MainView) An array of all attached instances. .. js:attribute:: visiableInstances read-only :type: Array(MainView) An array of all currently visivle instances (shown). .. js:attribute:: focusInstance read-only :type: MainView :default: undefined The currently focused instance or undefined if none is focused. .. js:function:: isManaged(instance) Test wether the instance is attached. :param MainView instance: The instance to test. :return: Is the instance attached? :rtype: Bool .. js:function:: isVisible(instance) Test wether the instance is visible. :param MainView instance: The instance to test. :return: Is the instance visible? :rtype: Bool .. js:function:: isFocused(instance) Test wether the instance is focused. :param MainView instance: The instnace to test. :return: Has the instance focus? :rtype: Bool .. js:function:: attach(instance[, viewArgs]) Attaches an instance. :param MainView instance: The instance to attach. :param Object viewArgs: An object holding further options for the placeing of the instance. :param MainView viewArgs.replace: Replaces this currently attached instance. If it is not valid instance to replace, this option will be ignored entirely. :param Tabber viewArgs.tabber: Attach the instance inside this tabber. Will attempt to resprect the following 2 parameters (for numeric placement). If it is not valid tabber, this option will be ignored entirely. :param MainView|Number viewArgs.leftOf: See :js:func:`attach` of :js:class:`UINodeCollection`. :param MainView|Number viewArgs.rightOf: See :js:func:`attach` of :js:class:`UINodeCollection`. :param Number viewArgs.focusIndex: The focus index for the instance to attach. The higher the index the more recent this instance had focus. The currently focused instance has the highest index. If this value is not present or *0* it will default to the currently highest index. Negative values will be used as and offset from the currently highest value. :param Number viewArgs.activeIndex: The active index. See :js:func:`attach` of :js:class:`Tabber`. .. note:: Both *viewArgs.leftOf* and *viewArgs.rightOf* are interpreted this way: * If it is not a valid Number it will be set to the highest index. * Negative numbers will be substracted from the currently highest active index, but are clipped at *0*. .. js:function:: detach(instance) Detaches a currently attached instance. :param MainView instance: Instance to detach. .. js:function:: focusNeighbor(dir) Focuses the neighboring instance left/right of the currently focused one. :param String dir: The direction of the neighbor. Valid values are *"+"* for left or *"-"* for right. .. js:function:: destroy() Destroys itself: Detaches all instances, stops listening to events and renders itself unusable. .. js:function:: byId(id) Retrieves an attached view by id. :param String id: The :js:attr:`id` of the view to retrieve. :return: The view, if available, else *null*. :rtype: MainView|null