Created
November 13, 2014 08:34
-
-
Save Sitebase/d235d1d8d11b919c116b to your computer and use it in GitHub Desktop.
Bootstrap custom BuboBox front-end module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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