API Reference 0.6.0bootjack_plugin

bootjack_plugin library

Functions

void setClass(Element element, String className, bool value) #

Add className to element CSS classes if value is true, Remove it otherwise.

void setClass(Element element, String className, bool value) {
 if (value)
   element.classes.add(className);
 else
   element.classes.remove(className);
}

String getDataTarget(Element element) #

Retrieve the value of data-target attribute of href attribute on given element.

String getDataTarget(Element element) =>
   fallback(element.attributes['data-target'], () => element.attributes['href']);

dynamic movein(a, b()) #

Equivalent to && operator in JavaScript.

movein(a, b()) => a == null ? null : b();

dynamic fallback(a, b(), [c(), d()]) #

Equivalent to || operator in JavaScript.

fallback(a, b(), [c(), d()]) => 
   c == null ? _fallback(a, b) :
   d == null ? _fallback(_fallback(a, b), c) :
   _fallback(_fallback(_fallback(a, b), c), d);

dynamic wire(Element element, String name, create()) #

Load a component from Element data space if available, otherwise create one.

wire(Element element, String name, create()) =>
    fallback($(element).data.get(name), create);

Classes