Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Sitebase
Created November 13, 2014 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sitebase/d235d1d8d11b919c116b to your computer and use it in GitHub Desktop.
Save Sitebase/d235d1d8d11b919c116b to your computer and use it in GitHub Desktop.
Bootstrap custom BuboBox front-end module
/**
* This is an example BBBX widget module
* It can be used to add additional functionallity to the BuboBox platform in a modularized way
*/
window.bbbx_modules = window.bbbx_modules || []; // Make modules array if not yet exists
window.bbbx_modules.push(function(sandbox, $) {
var NAME = 'custommodule';
var exports = {
NAME: NAME,
/**
* Module is registered inside the BuboBox widget
*/
init: function() {
console.error('Custom module initialized');
},
/**
* All modules are loaded
*/
ready: function() {
console.error('Custom module ready, all other modules are also loaded at this point');
},
/**
* Add listeners for certain actions that happen
* in the BuboBox widgets
*/
bind: function() {
//sandbox.subscribe('x', function);
},
/**
* Remove listeners we create in the bind function
*/
unbind: function() {
//sandbox.unsubscribe(['x', function]);
},
/**
* Clean up all stuff this module has created
* - DOM elements
* - Bindings
*/
destroy: function() {
// this.unbind();
// remove some left over DOM elments
}
};
return exports;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment