views/main ================= .. js:class:: MainView(args, viewArgs, baseArgs) :extends: BaseView The view used for most things. It's instances are managed by a :js:class:`ViewManager` instance and allow for abitrary position and size within the grid. :param Object args: See :js:class:`BaseView`. :param Object viewArgs: See :js:class:`BaseView` and :js:func:`attach` of :js:class:`ViewManager`. :param Object baseArgs: See :js:class:`BaseView`. .. js:attribute:: $tab read-only :type: jQuery The jQuery object holding the tab associated wit this instance. .. js:attribute:: $content read-only :type: jQuery The jQuery object containing the node that is holding the views content. .. js:attribute:: menu read-only :type: MenuButton The vue instance representing the menu of this view. .. js:function:: isManaged() :return: Wether this viwe is managed. If it is not applicable (no :js:attr:`master`) will return *null*. :rtype: Bool|null .. js:function:: isVisible() :return: Wether this view has focus. If it applicable (not :js:func:`isManaged`) will return *null*. :rtype: Bool|null .. js:function:: isFocused() :return: Wether this view has focus. If it applicable (not :js:func:`isManaged`) will return *null*. :rtype: Bool|null .. js:attribute:: icon :type: String The CSS class names assigned to the icon of the tab. .. js:attribute:: label :type: String The label that is displayed in the tab. Setting this is the same as calling :js:func:`setLabel` with the new label and *false* as second parameter. .. js:function:: setLabel(label[, isPath]) Sets the label to a new value. If is path ist true it will intrepret the name as a path. The path will be shortend as much as possible while avoiding the labels of peers. :param String label: The new label to be set. :param Bool isPath: Wether the label ist to be interpreted as a path. .. js:attribute:: modified :type: Bool Wether the tabs closing icon (cross) should indicate that the contents of this were modified but not yet saved by replacing it with an appropriate icon (pencil). .. js:function:: setLoading(loading[, delay]) Behaves just like the normal setLoading with the only difference that you can provide a delay to the visual representation of loading (when not loading previously). It is inthendes to be used with low delays (such as 0.2s) to hold up the illusion of a very responsive UI. :param Bool loading: Wether to increase or decrease the internal loading semaphore. :param Number delay: The delay in seconds until the loading indicatior will be shown after it was not already. .. note:: All following functions are to be overridden as need. Calling their *_super* is not required. .. js:function:: getFragment() Returns the fragment representing the the most important parts of the state of this view. Should use :js:func:`getState` to aquire the information for assembling the fragment. :return: The fragment. :rtype: String .. js:function:: applyFragment(fragment) Loades a state from the fragment given. Should us :js:func:`state.set` to forward the information aquired though the fragment. It must silently fail if the given fragment is malformed in any way. :param String fragment: The fragment the state is to be reconstructed from. .. js:function:: onFocus(opts) Bound to the *focus* event. :param opts: The same parameter as provided in :js:func:`focus` and it's *focus* event. .. js:function:: onBlur() Bound to the *blur* event. .. js:function:: onShow(opts) Bound to the *show* event. :param opts: The same parameter as provided in :js:func:`show` and in it's *show* event. .. js:function:: onHide() Bound to the *hide* event. .. js:function:: onClose() Bound to the *close* event. .. js:function:: onBeforeClose() This function is **always** called by :js:func:`close` to determine wether the closing of the view should be allowed. For example, if there are unsafed changes one use this function the check for them and trigger the safe process to prevent the changes from being lost. :return: If *false* is returned the closeing will not be performed. :rtype: Bool .. js:function:: onResize() Bound to the *resize* event. .. js:attribute:: mainMenuEntry :type: Object|null If available, this will be an automatically created object that can be used in the main menu.