Added support for running a function before the draw() function of a widget, for example when a widget needs to fetch additional user informations that aren't provided by the metadatas
--- a/src/js/widgets-container/widget.js Fri Sep 18 14:32:28 2015 +0200
+++ b/src/js/widgets-container/widget.js Fri Sep 18 14:39:45 2015 +0200
@@ -77,7 +77,13 @@
_this.media = _this.source.getCurrentMedia(_mediaopts);
}
- _this.draw();
+
+ if (_this.pre_draw_callback){
+ IriSP.jQuery.when(_this.pre_draw_callback()).done(_this.draw());
+ }
+ else {
+ _this.draw();
+ }
_this.player.trigger("widget-loaded");
}