HTMLElement Class
Item Index
Methods
bindModel
-
model
-
[mergeCurrent=false]
Binds a model to the plugin, making plugin.model equals the bound model. Immediately syncs the plugin with the new model-data.
Syncs the new vnode's childNodes with the dom.
definePlugin
-
plugin
-
[constructor]
-
[prototypes]
Creates a new Element-PluginClass.
Parameters:
Returns:
defineWhenUndefined
-
key
-
value
Defines the key
-property on element.model, but only when is hasn't been defined before.
Parameters:
-
key
Stringplugin.model's property
-
value
Anyits value to be set
getPlugin
-
plugin
Gets the plugin-instance of the specified plugin-name. Will fulfill as soon as the plugin is ready.
Parameters:
-
plugin
StringThe name of the plugin that should be plugged.
Returns:
the plugin-instance of the specified plugin-name
getPluginClass
-
plugin
Returns the PluginClass that belongs with the specified plugin
-name.
Parameters:
-
plugin
Stringthe namespace of the plugin
Returns:
isPlugged
-
plugin
Checks whether the plugin is plugged in at the HtmlElement. Checks whether all its attributes are set.
Parameters:
-
plugin
StringThe name of the plugin that should be plugged. Needs to be the Class, not an instance!
Returns:
whether the plugin is plugged in
plug
-
plugin
-
[config]
-
[model]
Plugs in the plugin on the HtmlElement, and gives is special behaviour by setting the appropriate attributes.
Parameters:
Returns:
the plugin's instance, or undefined in case of an unregistered plugin
pluginReady
-
plugin
Checks whether the plugin is ready to be used.
Parameters:
-
plugin
StringThe name of the plugin that should be ready.
Returns:
whether the plugin is plugged in
subClass
-
plugin
-
[constructor]
-
[prototypes]
-
[chainConstruct=true]
Returns a newly created class inheriting from this class
using the given constructor
with the
prototypes listed in prototypes
merged in.
The newly created class has the $$super
static property
available to access all of is ancestor's instance methods.
Further methods can be added via the mergePrototypes.
Parameters:
-
plugin
Stringthe namespace of the plugin
-
[constructor]
Function optionalThe function that will serve as constructor for the new class. If
undefined
defaults toNOOP
-
[prototypes]
Object optionalHash map of properties to be added to the prototype of the new class.
-
[chainConstruct=true]
Boolean optionalWhether -during instance creation- to automaticly construct in the complete hierarchy with the given constructor arguments.
Returns:
undefined when no valid namespace is given
Example:
var Circle = Shape.subClass( function (x, y, r) { // arguments will automaticly be passed through to Shape's constructor this.r = r; }, { area: function () { return this.r this.r Math.PI; } } );
unplug
-
PluginClass
Unplugs a NodePlugin from the HtmlElement.
Parameters:
-
PluginClass
NodePluginThe plugin that should be unplugged. Needs to be the Class, not an instance!