views/main

class MainView(args, viewArgs, baseArgs)
Extends:BaseView

The view used for most things. It’s instances are managed by a ViewManager() instance and allow for abitrary position and size within the grid.

Arguments:
read-only$tab
Type:jQuery

The jQuery object holding the tab associated wit this instance.

read-only$content
Type:jQuery

The jQuery object containing the node that is holding the views content.

Type:MenuButton

The vue instance representing the menu of this view.

isManaged()
Returns:Wether this viwe is managed. If it is not applicable (no master) will return null.
Return type:Bool|null
isVisible()
Returns:Wether this view has focus. If it applicable (not isManaged()) will return null.
Return type:Bool|null
isFocused()
Returns:Wether this view has focus. If it applicable (not isManaged()) will return null.
Return type:Bool|null
icon
Type:String

The CSS class names assigned to the icon of the tab.

label
Type:String

The label that is displayed in the tab. Setting this is the same as calling setLabel() with the new label and false as second parameter.

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.

Arguments:
  • label (String) – The new label to be set.
  • isPath (Bool) – Wether the label ist to be interpreted as a path.
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).

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.

Arguments:
  • loading (Bool) – Wether to increase or decrease the internal loading semaphore.
  • delay (Number) – 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.

getFragment()

Returns the fragment representing the the most important parts of the state of this view. Should use getState() to aquire the information for assembling the fragment.

Returns:The fragment.
Return type:String
applyFragment(fragment)

Loades a state from the fragment given. Should us state.set() to forward the information aquired though the fragment. It must silently fail if the given fragment is malformed in any way.

Arguments:
  • fragment (String) – The fragment the state is to be reconstructed from.
onFocus(opts)

Bound to the focus event.

Arguments:
  • opts – The same parameter as provided in focus() and it’s focus event.
onBlur()

Bound to the blur event.

onShow(opts)

Bound to the show event.

Arguments:
  • opts – The same parameter as provided in show() and in it’s show event.
onHide()

Bound to the hide event.

onClose()

Bound to the close event.

onBeforeClose()

This function is always called by 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.

Returns:If false is returned the closeing will not be performed.
Return type:Bool
onResize()

Bound to the resize event.

Type:Object|null

If available, this will be an automatically created object that can be used in the main menu.