Skip to content

Commit

Permalink
fixes the slides that does not scale correctly when they have codemir…
Browse files Browse the repository at this point in the history
…ror elements in them
  • Loading branch information
Fredrik Ekholdt committed Dec 17, 2012
1 parent 0569eb0 commit 2588f8d
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions deck.codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,26 +222,11 @@
};

$d.bind('deck.init', function() {

// codemirrorify current and next slide, since we're in the beginning.
codemirrorify($.deck('getSlide', 0));
codemirrorify($.deck('getSlide', 1));
});

$d.bind('deck.change', function(event, from, to) {
var $slides = $[deck]('getSlides');
// codemirrorify previous slide
if (to > 0) {
codemirrorify($.deck('getSlide', to - 1));
}

// codemirrorify current slide
codemirrorify($.deck('getSlide', to));

// codemirrorify next slide
if (to+1 < $slides.length) {
codemirrorify($.deck('getSlide', to + 1));
}
//codemirrorify all the decks so that scale is correctly computed
var slides = $[deck]('getSlides');
$(slides).each(function(i){
codemirrorify($.deck('getSlide', i));
});
});
})(jQuery, 'deck', this);

Expand Down

0 comments on commit 2588f8d

Please sign in to comment.