prevent same plugin from being registered twice
This commit is contained in:
parent
fbbae1dc55
commit
7b62a0f356
|
@ -1558,6 +1558,7 @@
|
||||||
*/
|
*/
|
||||||
function registerPlugin( id, plugin ) {
|
function registerPlugin( id, plugin ) {
|
||||||
|
|
||||||
|
if( plugins[id] === undefined ) {
|
||||||
plugins[id] = plugin;
|
plugins[id] = plugin;
|
||||||
|
|
||||||
// If a plugin is registered after reveal.js is loaded,
|
// If a plugin is registered after reveal.js is loaded,
|
||||||
|
@ -1565,6 +1566,10 @@
|
||||||
if( loaded && typeof plugin.init === 'function' ) {
|
if( loaded && typeof plugin.init === 'function' ) {
|
||||||
plugin.init();
|
plugin.init();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.warn( 'reveal.js: "'+ id +'" plugin has already been registered' );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue