aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2019-03-01 21:34:11 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2019-03-01 21:34:11 +0100
commit46f8f86fa1d682e913459c13b5131f2baa25bcb5 (patch)
tree491469652801c978ac780548023f6f74b05aaadd /js
parent4862de26eb75d44b36849ef574db986203d3c879 (diff)
downloadperl-software-in-gnu-guix-46f8f86fa1d682e913459c13b5131f2baa25bcb5.tar
perl-software-in-gnu-guix-46f8f86fa1d682e913459c13b5131f2baa25bcb5.tar.gz
few plugin registration tweaks
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 9b29f78..9da7f8f 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -519,24 +519,25 @@
if( typeof s.callback === 'function' ) s.callback();
if( --scriptsToLoad === 0 ) {
- loadPlugins();
+ initPlugins();
}
} );
} );
}
else {
- loadPlugins();
+ initPlugins();
}
}
/**
- * Loads all plugins that require preloading.
+ * Initializes our plugins and waits for them to be ready
+ * before proceeding.
*/
- function loadPlugins() {
+ function initPlugins() {
- var pluginsToLoad = Object.keys( plugins ).length;
+ var pluginsToInitialize = Object.keys( plugins ).length;
for( var i in plugins ) {
@@ -546,18 +547,18 @@
// wait for the callback
if( typeof plugin.init === 'function' ) {
plugin.init( function() {
- if( --pluginsToLoad === 0 ) {
+ if( --pluginsToInitialize === 0 ) {
loadAsyncDependencies();
}
} );
}
else {
- pluginsToLoad -= 1;
+ pluginsToInitialize -= 1;
}
}
- if( pluginsToLoad === 0 ) {
+ if( pluginsToInitialize === 0 ) {
loadAsyncDependencies();
}
@@ -5894,7 +5895,7 @@
addKeyBinding: addKeyBinding,
removeKeyBinding: removeKeyBinding,
- // Called by plugins to register/unregister themselves
+ // Called by plugins to register themselves
registerPlugin: registerPlugin,
// Programatically triggers a keyboard event