1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-11 00:55:01 +02:00

move plugin logic to Plugins controller

This commit is contained in:
Hakim El Hattab
2020-03-07 18:22:19 +01:00
parent 0814176f3c
commit d4a030f953
7 changed files with 235 additions and 187 deletions

View File

@@ -1,12 +1,21 @@
import _reveal from './reveal.js'
import Presentation from './reveal.js'
// The Reveal class can be instantiated to run multiple
// presentations on the same page
window.Reveal = _reveal;
//
// let rvl = new Reveal( <HTMLElement>, { controls: false } )
// rvl.initialize()
// rvl.slide(2)
window.Reveal = Presentation;
// Simplified way to create a reveal.js instance on
// a page with only one presentation, makes us backwards
// compatible with reveal.js pre 4.0
//
// Reveal.initialize({ controls: false })
// Revea.slide(2)
window.Reveal.initialize = options => {
window.Reveal = new _reveal( document.querySelector( '.reveal' ), options );
window.Reveal = new Presentation( document.querySelector( '.reveal' ), options );
window.Reveal.initialize();
return new Promise( resolve => window.Reveal.addEventListener( 'ready', resolve ) );
}