$(this).attr('id') => this.id
init: function() {
pictureViewer.init(); // CONTEXT SHOULD BE REMOVED
...lots of set-up method calls...
}
init: function() {
news.pubsub.emit('pictureGallery:initialized')
...lots of set-up method calls...
}
var PictureViewer = {
...code...
init: function() {
...lots of set-up method calls...
this.bindEvents();
}
}
var PictureViewer = {
...code...
init: function() {
...lots of set-up method calls...
this.bindEvents();
}
}
news.pubsub.on('pictureGallery:initialized', PictureViewer.init);
For full details see:
https://gist.github.com/Integralist/47f424ab3e275fcac093