Skip to content

Commit

Permalink
Merge pull request #39 from bfred-it/patch-1
Browse files Browse the repository at this point in the history
Avoid triggering a global resize just to run a function
  • Loading branch information
RobertoGonzalez committed Sep 29, 2015
2 parents bbd7411 + c51ffef commit 8f096b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions midnight.jquery.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@
}, 1000);


// We need to recalculate all this._sections and headers on resize.
// We need to recalculate all this._sections and headers
context.recalculate();


// and at every resize
$(window).resize(function(){
context.recalculate();
}).trigger('resize');
});


// Start the RequestAnimationFrame loop. This should be done just once.
Expand Down

0 comments on commit 8f096b9

Please sign in to comment.