Picture of Gavin Nelson
Re: Delaying course loading
by Gavin Nelson - Wednesday, 6 August 2014, 3:20 PM
 

you could make your code more adapt-like by using adapts trigger and listen to methods

myplugin.trigger('rerender'); would become Adapt.trigger('myPlugin:rerender');

and this.on('myPlugin:rerender', this.render); would become this.listenTo(Adapt, 'myPlugin:rerender', this.render);

I dont think this affects how it runs but it will keep the events local to adapt. Also if your plugin will always fire this event, you might be able to take out the original call to render (if you haven't done so already) to avoid rendering the menu twice.