Open zofe opened 8 years ago
Furthermore, the onload event will not be applied on newly created widgets.
rapydInit(selector)
javascript function.$(function(){ rapidyInit('body'); });
rapydInit('.my-data-embed');
first of all 'mixins' seems to share behaviors across different tags, but it's not our case.. dataembed is the same for each widget.
what about place the logic in the "build" context of each widget?
about 3, we can check if css or js is already included or append assets to the parent via jquery:
//widget->output ..then, for each css/js asset
if (!$("script[src='path/to/rapyd/assets/compoment.js']").length){
$.getScript( "path/to/rapyd/assets/compoment.js");
}
//then ..inline script for component
It seems reasonable, logic is serverside.. needed refactoring is:
Ill work on it asap
when widget is embedded and built by a dataembed we have a problem: if the widget contains javascripts and/or css this "inclusion" stack is not "propagated" to the "container" i.e.:
Styles and Scripts are printed on page, but dataembeds are loaded asynchronously, "after" page is loaded.So we need to found a way to share the assets stack to the "page".