Skip to content

Commit

Permalink
Update tocify to recache headers on image load, fixes #293
Browse files Browse the repository at this point in the history
  • Loading branch information
lord committed Jul 7, 2015
1 parent ae3d502 commit ad3b276
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 9 additions & 4 deletions source/javascripts/app/_toc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//= require ../lib/_jquery_ui
//= require ../lib/_jquery.tocify
//= require ../lib/_imagesloaded.min
(function (global) {
'use strict';

Expand Down Expand Up @@ -37,14 +38,18 @@

// Hack to make already open sections to start opened,
// instead of displaying an ugly animation
function animate () {
function animate() {
setTimeout(function() {
toc.setOption('showEffectSpeed', 180);
}, 50);
}

$(makeToc);
$(animate);

$(function() {
makeToc();
animate();
$('.content').imagesLoaded( function() {
global.toc.calculateHeights();
});
});
})(window);

7 changes: 7 additions & 0 deletions source/javascripts/lib/_imagesloaded.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad3b276

Please sign in to comment.