Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
loader always calls the callback even when no work is required.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jan 18, 2014
1 parent 0d211f4 commit 0c3bf9d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ var loader = {
} else {
this.platformLoadStyles(styles, callback);
}
return true;
} else if (callback) {
callback();
}
},
findLoadableStyles: function(root) {
var loadables = [];
var s$ = root.querySelectorAll(STYLE_SELECTOR);
for (var i=0, l=s$.length, s; (i<l) && (s=s$[i]); i++) {
if (s.textContent.match(STYLE_LOADABLE_MATCH)) {
loadables.push(s);
if (root) {
var s$ = root.querySelectorAll(STYLE_SELECTOR);
for (var i=0, l=s$.length, s; (i<l) && (s=s$[i]); i++) {
if (s.textContent.match(STYLE_LOADABLE_MATCH)) {
loadables.push(s);
}
}
}
return loadables;
Expand Down

0 comments on commit 0c3bf9d

Please sign in to comment.