Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Seales
Kubernetes Presentation
Commits
ddbe06eb
Commit
ddbe06eb
authored
Mar 10, 2020
by
Hakim El Hattab
Browse files
adjustments to reveal.js initialization flow
parent
9336fc11
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
demo.html
View file @
ddbe06eb
...
...
@@ -410,13 +410,6 @@ Reveal.addEventListener( 'customevent', function() {
<script
type=
"module"
>
// WIP support for multiple reveal.js instances
// window.a = new Reveal(document.querySelector( '.reveal' ), {controls: false});
// a.initialize();
// window.b = new Reveal(document.querySelector( '.reveal' ), {controls: true});
// b.initialize();
// console.log(a.getConfig().controls,b.getConfig().controls);
// More info https://github.com/hakimel/reveal.js#configuration
Reveal
.
initialize
({
controls
:
true
,
...
...
@@ -439,5 +432,22 @@ Reveal.addEventListener( 'customevent', function() {
</script>
<!--
<script type="module">
// WIP support for multiple reveal.js instances
import Reveal from '/js/reveal.js'
window.a = new Reveal(document.querySelector( '.reveal' ), {controls: false});
a.initialize();
window.b = new Reveal(document.querySelector( '.reveal' ), {controls: true});
b.initialize();
console.log(a.getConfig().controls,b.getConfig().controls);
</script>
-->
</body>
</html>
dist/reveal.min.js
View file @
ddbe06eb
This diff is collapsed.
Click to expand it.
js/index.js
View file @
ddbe06eb
import
Presentation
from
'
./reveal.js
'
// The Reveal class can be instantiated to run multiple
// presentations on the same page
//
// 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
// Provides a backwards compatible way to initialize
// reveal.js when there is only one presentation on
// the page.
//
// Reveal.initialize({ controls: false })
// Revea.slide(2)
window
.
Reveal
.
initialize
=
options
=>
{
window
.
Reveal
=
new
Presentation
(
document
.
querySelector
(
'
.reveal
'
),
options
);
window
.
Reveal
.
initialize
();
return
new
Promise
(
resolve
=>
window
.
Reveal
.
addEventListener
(
'
ready
'
,
resolve
)
);
// Reveal.slide(2)
window
.
Reveal
=
{
initialize
:
options
=>
{
window
.
Reveal
=
new
Presentation
(
document
.
querySelector
(
'
.reveal
'
),
options
);
return
window
.
Reveal
.
initialize
();
}
}
\ No newline at end of file
js/reveal.js
View file @
ddbe06eb
...
...
@@ -153,7 +153,7 @@ export default function( revealElement, options ) {
// Load plugins then move on to #start()
plugins
.
load
(
config
.
dependencies
).
then
(
start
)
return
Reveal
;
return
new
Promise
(
resolve
=>
Reveal
.
addEventListener
(
'
ready
'
,
resolve
)
)
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment