How can I destroy Reveal after the use?
Reveal.initialize(); // first initialization
... // usage
Reveal.destroy(); // clean up && reset internal state?
So I can use it again (show same or another presentation) without messing up the slides?
That would be super helpful, when loading presentations dynamically.
:+1: We really need this feature! For now I just did the hackish way and use Reveal.removeEventListeners() and Reveal.addEventListeners()
Thanks for the tipp with the EventListeners. I noticed that this is not enough in my case. I try to dynamically reload the presentation and the layout gets messy.
After initializing I do this:
// rearrange layout
Reveal.layout();
try {
Reveal.slide(0, 0, 0);
} catch (ex) {
// figure out why this happens sometimes
console.log(ex);
}
Reveal is awesome, but it ends up breaking the scrolling functionality in my application. The WORKAROUND is really simple.... instead of opening the presentation in the same window/page, you should just pop it up in a new window. In your
Loading in a new window allows Reveal.js to manipulate the dom only for the window it opens in, and allows the rest of the app to run normally. <a href="linkToPresentation" target="_blank">Some Presentation In New Window</a>1145
Closing as duplicate of #1145:
There isn't, reveal.js makes lots of changes to the DOM so it would be difficult to roll all that back. Perhaps you could work around this by reloading the page and not initializing the framework.
Even reloading the page doesn't work, this issue needs to be reopened.
@akash-pal I found out that this resets your presentation even if your dom has changed
Reveal.initialize()
Reveal.slide(-1, -1, -1)
Reveal.sync()
@MaximVanhove thanks for your reply,
I actually commented out the below line:
```
// Make sure we only initialize once
// if( initialized === true ) return;
This enabled me to initialize again when I changed the page.
I also had autoSlide on
`Reveal.configure({ autoSlide: 4000 });`
So when I changed the page, I wrote a function to cancel the time and slide to the first slide.
```
cancelTimer: function(){
pause();
slide(0);
}
I have then exposed the cancelTimer via the API.
This way I am able to use reveal in AngularJS
Great that you got it working. I'm actually using this in Vue 馃榾
@akash-pal I found out that this resets your presentation even if your dom has changed
Reveal.initialize() Reveal.slide(-1, -1, -1) Reveal.sync()
thank you. you save my day
Most helpful comment
@akash-pal I found out that this resets your presentation even if your dom has changed