mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-26 08:11:17 +02:00
make monaco stylesheet insert just once
This commit is contained in:
@@ -305,11 +305,14 @@ export function loadJS(src) {
|
||||
return d.promise;
|
||||
}
|
||||
|
||||
export function loadCss(src) {
|
||||
export function loadCss({ url, id }) {
|
||||
var d = deferred();
|
||||
var style = window.document.createElement('link');
|
||||
style.setAttribute('href', src);
|
||||
style.setAttribute('href', url);
|
||||
style.setAttribute('rel', 'stylesheet');
|
||||
if (id) {
|
||||
style.setAttribute('id', id);
|
||||
}
|
||||
document.head.appendChild(style);
|
||||
style.onload = function() {
|
||||
d.resolve();
|
||||
|
Reference in New Issue
Block a user