control-freak-ide/server/nodejs/tests/addCss.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

23 lines
677 B
JavaScript

define([ 'require' ], function (require) {
console.error('add css');
return {
// Expose this module as an AMD plugin which will wait until the
// link element has loaded the stylesheet.
// (This uses least-common-denominator logic from xstyle/core/load-css.)
load: function (id, parentRequire, loaded) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = require.toUrl('../grid.css');
console.error('addcss ' +link.href);
document.getElementsByTagName('head')[0].appendChild(link);
var interval = setInterval(function () {
if (link.style) {
clearInterval(interval);
loaded();
}
}, 15);
}
};
});