add 'plugins' config option, new way of registering es5 plugins
This commit is contained in:
@ -276,6 +276,9 @@ export default {
|
||||
hideCursorTime: 5000,
|
||||
|
||||
// Script dependencies to load
|
||||
dependencies: []
|
||||
dependencies: [],
|
||||
|
||||
// Plugin objects to register and use for this presentation
|
||||
plugins: []
|
||||
|
||||
}
|
@ -20,11 +20,16 @@ export default class Plugins {
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the dependencies of reveal.js. Dependencies are
|
||||
* defined via the configuration option 'dependencies'
|
||||
* and will be loaded prior to starting/binding reveal.js.
|
||||
* Loads reveal.js dependencies and registers plugins.
|
||||
*
|
||||
* Dependencies are defined via the 'dependencies' config
|
||||
* option and will be loaded prior to starting reveal.js.
|
||||
* Some dependencies may have an 'async' flag, if so they
|
||||
* will load after reveal.js has been started up.
|
||||
*
|
||||
* Plugins are direct references to a reveal.js plugin
|
||||
* object that we register and initialize after any
|
||||
* synchronous dependencies have loaded.
|
||||
*/
|
||||
load( dependencies ) {
|
||||
|
||||
|
@ -145,7 +145,7 @@ export default function( revealElement, options ) {
|
||||
window.addEventListener( 'load', layout, false );
|
||||
|
||||
// Load plugins then move on to #start()
|
||||
plugins.load( config.dependencies ).then( start );
|
||||
plugins.load( [...config.dependencies, ...config.plugins] ).then( start );
|
||||
|
||||
return new Promise( resolve => Reveal.on( 'ready', resolve ) );
|
||||
|
||||
|
Reference in New Issue
Block a user