-
Notifications
You must be signed in to change notification settings - Fork 0
Library Helpers
Home > Widget-Libraries > Helpers
Maqetta attempts to do the best it can for most widgets, but for some widgets the default action may not be appropriate or enough. Maqetta makes use of helper objects, which contain callbacks which are invoked at the appropriate time.
Maqetta supports the following "helper" code files:
- "helper" - Can provide Maqetta with additional info on the widget, data which cannot solely be specified as metadata.
- "tool" - Allows customization of how the widget is created when added to the page.
- "callbacks" - Library level callbacks, providing additional functionality across all the library's widgets.
- "themeHelper" - Can provide Maqetta with additional info on the theme, data which cannot solely be specified as theme metadata.
The helper
property in widgets.json specifies an AMD module path, relative to the widgets.json file itself. For example,
"helper": "./dojox/mobile/TabBarButtonHelper"
In general, keep the Helper JS file alongside the corresponding widget's OAM file.
See the Helper skeleton for the docs on functions you can implement.
Like "helper", "tool" points to an AMD module path. See the full description in that section above.
See the CreateTool skeleton for the docs on functions you can implement.
A JS object whose functions may be called during widget actions. Functions are called for all widgets in the library.
See the callbacks skeleton for the docs on functions you can implement.
The helper
property in [[.theme | Theme-Editor-Tech-Documentation]] specifies an AMD module path, relative to toolkits widgets.json file itself. For example,
"helper":"maq-metadata-dojo/dojox/mobile/ThemeHelper"
In general, keep the Helper JS file alongside the toolkits widget's OAM files.
See the ThemeHelper skeleton for the docs on functions you can implement.