Open medikoo opened 10 years ago
This looks good. Could you squash this into a single commit?
Done
I don't think it's necessary to set the slideHeight
and slideWidth
variables in the main block anymore. In fact, even the firstSlide
variable is probably better assigned in the scaleAll
method.
I recommend moving this whole block into the scaleAll
method.
var firstSlide = deck.slides[0],
slideHeight = firstSlide.offsetHeight,
slideWidth = firstSlide.offsetWidth;
Currently bespoke-scale saves slide dimensions at initialization and refers to it through further process, it doesn't work well, if for some reason we changed slides size during the presentation.
I have such use case when using bespoke-notes plugin. It allows to optionally display notes aside of slide (then slide width becomes twice as long as initial one). Additionally it dispatches
resize
event to invoke any eventual resize related logic. Still bespoke-scale doesn't pick size change, and presentation needs to be brutally reloaded to adjust to new size.Demo of this case: http://medikoo.com/asynchronous-javascript-interfaces/ (press
n
key to toggle notes).This change fixes that.