backwards compatibility, reveal.js 4.0 can now register ~3.9 plugins

This commit is contained in:
Hakim El Hattab 2020-04-21 13:34:40 +02:00
parent de50b4153c
commit faaa791019
5 changed files with 11 additions and 4 deletions

2
dist/reveal.es5.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

2
dist/reveal.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -177,6 +177,13 @@ export default class Plugins {
*/
registerPlugin( plugin ) {
// Backwards compatibility to make reveal.js ~3.9.0
// plugins work with reveal.js 4.0.0
if( arguments.length === 2 && typeof arguments[0] === 'string' ) {
plugin = arguments[1];
plugin.id = arguments[0];
}
let id = plugin.id;
if( typeof id !== 'string' ) {