denehyg / reveal.js-menu

Slide out menu for reveal.js
https://denehyg.github.io/reveal.js-menu
MIT License
281 stars 76 forks source link

`m` does not work from speaker notes window #17

Closed aspiers closed 8 years ago

aspiers commented 8 years ago

If I press m in the speaker notes window, it should slide in the menu from the left, either in the speaker notes window, or in the main presentation window. Probably it's better to do it in the speaker window, since the keyboard is already focused there so you can continue to navigate the menu from the same window.

denehyg commented 8 years ago

The menu does open in the speaker notes but you need to make sure the presentation frame in the speaker notes has focus so it receives the keypress. As the speaker notes loads another copy of the presentation in an iframe it also loads another copy of the menu plugin that works independently.

While it should be possible for the menu plugin in the main presentation to listen for triggerKey postMessages from the speaker notes plugin to toggle the menu in the main presentation, I'll need to give it some thought as to how this can be synced with the speaker notes copy.

aspiers commented 8 years ago

Ah yes, now I see that the m key works if and only if I click in the iframe inside the speaker notes window. I don't think it's necessary for the main presentation to react to presses of the m key from within the speaker notes window, but if m is pressed when browser focus is (say) on the clock part of the window, it should still work from there.

denehyg commented 8 years ago

I've pushed an update to the dev branch to handle this. Keypresses in the speaker notes will be propagated to the presentation in the speaker notes window and should behave as expected. The main window will not be affected. In the future I may look at syncing the main window as an option as there are some inconsistencies that also need to be addressed, eg changing the theme in the speaker notes has no affect on the main window.

aspiers commented 8 years ago

That's great, thanks!