-
Notifications
You must be signed in to change notification settings - Fork 857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let the user add extra setup to slides #22
Conversation
…r or name in many cases it might be helpful for the user to be able to look up the name or number of the currently visible slide. to facilitate this, i added to the <div class='slide'> element a title property. This is set either to the slide's name using "name:" or the slide's number in the stack. This can be accessed in the slidein callback using slide.title.
…user sending the 'pauseRemark' message will mean that interaction (e.g., key presses, etc…) are ignored by remark. this lets the user overload those and add custom interaction elements within a slide. sending 'resumeRemark' passes control based to Remark.
…hen the show() or hide() event is over rather than beginning made more sense and previous way was causing problems when using slidein to trigger modifications to the dom (which was still being modified by remark).
Okay, so I'll try commenting each commit:
I really haven't given the whole API stuff that much thought so far - it has evolved through pull request, more or less. It definitely deserves more attention for the upcoming releases :) Ole Petter |
Hi, all of these points sound reasonable to me. When I get a chance I will whip up some altered commits that follow these suggestions. One thought about For example, in my example deck, it would be nice to have all of remark's touch handling code still trigger events in my custom javascript. In this case, I guess the function would be more like I guess the design question is how much remark should "get out of the way" and let the user do the heavy lifting in coding new event handlers from scratch, or if it should stay active and just let the user know what's going on... |
I agree, I seems useful that remark handles all the events and still signals when an event triggering slide navigation has occured. Currently, remark only notifies when the slide is being changed, so some new events would perhaps be required. An alternative, and perhaps better (?), approach than deactivating a part of remark like this, is to make some What do you think? |
Was working on a couple of these things and came up with a minor comment: without explicitly importing the console into the
I should probably be able to sort this out myself, but importing explicitly works (e.g., you can call |
You get that error due to the linting with jshint during build. |
A 'ready' event has now been added via issue #25. |
Let's see, my first attempt at a pull request on github... and it is one line of code (starting to understand things)!
In addition to the idea in issue #10 which lets the user run some custom code when a slide appears (or hides), it may also be useful to execute some code after remark has been initialized. One example, for me, was that I wanted to programmatically add some styling to all the slides (e.g., insert a div into all the slides which contains a logo).
This pull request just adds a "remarkReady" event which is emitted after remark finishes setting up.
This can be used following kjbekkelund's approach like this: