Skip to content

Commit

Permalink
Refactor util-request.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lifesinger committed Mar 29, 2013
1 parent be47ec7 commit b834ae5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function addOnload(node, callback, isCSS) {

// Remove the script to reduce memory leak
if (!isCSS && !configData.debug) {
head.removeChild(node)
removeNode(node)
}

// Dereference the node
Expand All @@ -86,6 +86,10 @@ function addOnload(node, callback, isCSS) {
}
}

function removeNode(id) {
head.removeChild(isString(id) ? doc.getElementById(id) : id)
}

function pollCss(node, callback) {
var sheet = node.sheet
var isLoaded
Expand Down

0 comments on commit b834ae5

Please sign in to comment.