Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Widget = new Class({
- Implements: Events,
- initialize: function(arg1){
- //Initialize me
- },
- run: function(){
- this.fireEvent('onStart', maybe_some_args)
- //Do a bunch of shit
- this.fireEvent('onComplete', maybe_some_args)
- }
- });
- var Loading = {
- setup: function(class_that_implements_events) {
- class_that_implements_events.addEvents({
- 'onStart': this.startLoading,
- 'onComplete': this.stopLoading
- })
- class_that_implements_events.run()
- },
- startLoading: function(args) {
- //set some styles
- },
- stopLoading: function(args) {
- //set some styles
- }
- }
- Loading.setup(new Widget("nice"))
Add Comment
Please, Sign In to add comment