Skip to content

Commit 377d673

Browse files
Gaspar Robertfecz0
authored andcommitted
reverse styling changes.
1 parent 1b1773f commit 377d673

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/basic-loader.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
function _load(tag) {
22
// attributes example: { 'data-test': 'new-attribute-here' }
3-
return function(url, attributes = {}) {
3+
return function (url, attributes = {}) {
44
// This promise will be used by Promise.all to determine success or failure
55
return new Promise((resolve, reject) => {
66
let element = document.createElement(tag);
7-
let parent = "body";
8-
let attr = "src";
7+
let parent = 'body';
8+
let attr = 'src';
99

1010
// Important success and error for the promise
1111
element.onload = () => resolve(url);
1212
element.onerror = () => reject(url); // maybe we should remove the broken node, who knows
1313

1414
// Need to set different attributes depending on tag type
1515
switch (tag) {
16-
case "script":
16+
case 'script':
1717
element.async = true;
1818
break;
19-
case "link":
20-
element.type = "text/css";
21-
element.rel = "stylesheet";
22-
attr = "href";
23-
parent = "head";
19+
case 'link':
20+
element.type = 'text/css';
21+
element.rel = 'stylesheet';
22+
attr = 'href';
23+
parent = 'head';
2424
}
2525

2626
// Inject into document to kick off loading
@@ -35,7 +35,7 @@ function _load(tag) {
3535

3636
// exporting a "default" would render the amd package to work differently
3737
module.exports = {
38-
css: _load("link"),
39-
js: _load("script"),
40-
img: _load("img")
38+
css: _load('link'),
39+
js: _load('script'),
40+
img: _load('img')
4141
};

0 commit comments

Comments
 (0)