Skip to content

Commit

Permalink
Adding respondFinished event
Browse files Browse the repository at this point in the history
Need to know when respond has done its thing in IE8 so I can calculate an elements width accuratley
  • Loading branch information
kulor committed Jun 18, 2014
1 parent 6d9b409 commit 2161214
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/respond.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@

//recurse through request queue, get css text
makeRequests = function(){
var event;
if( requestQueue.length ){
var thisRequest = requestQueue.shift();

Expand All @@ -296,6 +297,11 @@
w.setTimeout(function(){ makeRequests(); },0);
} );
}
// Taken from http://stackoverflow.com/questions/23253623/how-to-create-a-custom-event-listener-for-respond-js
else {
event = new Event("respondFinished");
document.dispatchEvent(event);
}
},

//loop stylesheets, send text content to translate
Expand Down

0 comments on commit 2161214

Please sign in to comment.