iptools-jquery-manager
v0.2.1
Published
Component manager for dynamic initialisation of IPT components from markup
Downloads
1
Maintainers
Readme
iptools-jquery-manager
Component manager for dynamic initialisation of IPT components from markup.
Features
- Initialise iptools-jquery components
- with options from markup using
initComponents()
API call, e.g.$('body').data('plugin_iptManager').initComponents();
- on custom event, e.g.
ajax:complete
(default) when using jquery-ujs
- with options from markup using
Requirements
jQuery >=1.11.3 <4.0.0
Usage
Component definition in markup
Components that should automatically initialise must define data-component
and data-component-options
(optional) attributes on HTML element, e.g.:
<nav data-component="iptMlhMenu" data-component-options="{'title': 'Menu', 'subtitle': '', 'breakPalm': 720, 'menuExtensions': ['theme-pioneers', 'effect-slide-menu', 'multiline'] }">
...
</nav>
Component manager initialisation
$('body').iptManager({
callback: function() {}, // Callback function executed on component initialisation. Defaults to null.
initEvent: 'ajax:complete', // Initialisation event that is thrown to (re)initialise components. Defaults to ajax:complete.
initEventEmitter: 'body' // Selector for element that will emit initialisation event. Defaults to body.
});
Contributions
See CONTRIBUTING.
Licence
Copyright © 2017 Interactive Pioneers GmbH. Licenced under GPL-3.