dock ⇒ Weavy.plugins.dock

The main dock containing bubble buttons and panel managment.

Kind: global plugin

presets.dock ⇒ Weavy.presets.dock

Preset for loading the dock with all needed plugins and styles.

Extends: presets
Example
var dock = new Weavy(Weavy.presets.dock);

Instance members

weavy.nodes ⇐ weavy.nodes

The nodes placeholder in Weavy

Kind: instance property of dock
Extends: weavy.nodes

weavy.nodes.dockContainer : Element

Main element containing the dock

Kind: instance property of weavy.nodes
Created: Widget event: build

weavy.nodes.dock : Element

The main dock element. This is where buttons etc are added. It's a good idea to check if the dock is created before you add buttons or do other modifications.

Kind: instance property of weavy.nodes
Created: Widget event: build
Example
weavy.on("after:build", function() {
    if (weavy.nodes.dock) {
        weavy.nodes.dock.classList.add("myclass");
    }
})

weavy.nodes.bubblesGlobal : Element

Subcontainer for global bubbles

Kind: instance property of weavy.nodes
Created: Widget event: build
See: bubbles

weavy.nodes.bubblesPersonal : Element

Subcontainer for personal bubbles

Kind: instance property of weavy.nodes
Created: Widget event: build
See: bubbles

weavy.nodes.weavyButtonContainer : Element

Container for the weavy general button. This button is used for opening the authentication panel och as a simple placeholder when no other buttons have been added

Kind: instance property of weavy.nodes
Created: Widget event: build
See: authentication

weavy.nodes.weavyButton : Element

The actual button element inside the weavyButtonContainer

Kind: instance property of weavy.nodes
Created: Widget event: build

weavy.addButton(panelId, attributes) ⇒ Element

Creates a button and adds it to the dock. Sort the buttons right after all buttons are created using the before:build event.

Kind: instance method of dock
ParamTypeDescription
panelIdstring

The id of the button. Should normally match the panel it represents.

attributes
attributes.typestring

Optional type that will be added as data-type attribute on the button container

attributes.titlestring

Title for the button

attributes.iconUrlurl

Url to the avatar that fills up the button

attributes.iconhtml

Custom icon such as an svg. Represented as a HTML string.

attributes.iconTransparentboolean

Makes the button have a transparent background suitable for icons

attributes.clickfunction

Custom click function. Replaces the default panel toggle. false disables clicks.

Example
weavy.on("build", function() {
    if (weavy.isAuthenticated()) {
        weavy.myButton = weavy.addButton("mybutton", { 
            title: "My Button", 
            icon: "...", 
            iconTransparent: true,
            click: false
        });
    }
})

weavy.on("after:build", function (e) {
    if (weavy.isAuthenticated()) {
        if (weavy.nodes.dock) {
            // Place the button before the global bubbles
            weavy.nodes.dock.insertBefore(weavy.myButton, weavy.nodes.bubblesGlobal);
        }
    }
});

weavy.removeButton(panelId)

Removes a button from the dock instantly. Also creates a duplicate of the button that is removed after transitions has finished.

Kind: instance method of dock
ParamTypeDescription
panelIdstring

The id of the button to remove


Events

"bubble-init" ⇒ Object

Triggered when a bubble button is added to the dock. It can be used for adding additional functionality to bubble buttons.

Kind: event emitted by dock
Category: events
Properties
NameTypeDescription
isAddedboolean

True if the bubble was created, false if it already existed

bubbleBubble

Bubble data

containerElement

The outer button container.

panelElement

The panel for the bubble


Static members

.defaults : Object

Default plugin options

Kind: static property of dock
Properties
NameTypeDefaultDescription
classNamestring

Classes added to the dockContainer

positionClassNamestring "weavy-middle"

Classes added to weavy.nodes.container to set the default position of the dock.
weavy-left
weavy-right
weavy-top
weavy-middle
weavy-bottom

panelsClassNamestring "weavy-dock-panels"

Classes added to the panels container.

themeClassNamestring "weavy-extended"

Default theme class used by the dock.
weavy-default - only basic styles
weavy-extended - all styles for the dock
weavy-custom - only core styles

Example
Weavy.plugins.dock.defaults = {
    className: "",
    positionClassName: "weavy-middle",
    panelsClassName: "weavy-dock-panels",
    themeClassName: "weavy-extended"
};

.dependencies : Array.<string>

Non-optional dependencies.

Kind: static property of dock