Skip to content

Conversation

@medikoo
Copy link

@medikoo medikoo commented Apr 23, 2014

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.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 9b48e0b on medikoo:reread-slide-size into 50f36a1 on markdalgleish:master.

@markdalgleish
Copy link
Member

This looks good. Could you squash this into a single commit?

@medikoo
Copy link
Author

medikoo commented Sep 9, 2014

Done

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling fb44c7a on medikoo:reread-slide-size into 50f36a1 on markdalgleish:master.

@mojavelinux
Copy link

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;

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 12f3d8c on medikoo:reread-slide-size into * on bespokejs:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 08a1103 on medikoo:reread-slide-size into * on bespokejs:master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants