Permalink
Browse files

Adding respondFinished event

Need to know when respond has done its thing in IE8 so I can calculate an elements width accuratley
  • Loading branch information...
1 parent 6d9b409 commit 216121408dad76c70e481e8d1448bdf43034bb01 @kulor committed Jun 18, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/respond.js
View
@@ -284,6 +284,7 @@
//recurse through request queue, get css text
makeRequests = function(){
+ var event;
if( requestQueue.length ){
var thisRequest = requestQueue.shift();
@@ -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

0 comments on commit 2161214

Please sign in to comment.