add getRevealElement API method
This commit is contained in:
parent
f042a8c394
commit
8ac3383bee
@ -592,6 +592,9 @@ Reveal.isLastSlide();
|
|||||||
Reveal.isOverview();
|
Reveal.isOverview();
|
||||||
Reveal.isPaused();
|
Reveal.isPaused();
|
||||||
Reveal.isAutoSliding();
|
Reveal.isAutoSliding();
|
||||||
|
|
||||||
|
// Returns the top-level DOM element
|
||||||
|
getRevealElement(); // <div class="reveal">...</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Key Bindings
|
### Custom Key Bindings
|
||||||
|
@ -5683,6 +5683,11 @@
|
|||||||
return query;
|
return query;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Returns the top-level DOM element
|
||||||
|
getRevealElement: function() {
|
||||||
|
return dom.wrapper || document.querySelector( '.reveal' );
|
||||||
|
},
|
||||||
|
|
||||||
// Returns true if we're currently on the first slide
|
// Returns true if we're currently on the first slide
|
||||||
isFirstSlide: function() {
|
isFirstSlide: function() {
|
||||||
return ( indexh === 0 && indexv === 0 );
|
return ( indexh === 0 && indexv === 0 );
|
||||||
@ -5724,12 +5729,12 @@
|
|||||||
// Forward event binding to the reveal DOM element
|
// Forward event binding to the reveal DOM element
|
||||||
addEventListener: function( type, listener, useCapture ) {
|
addEventListener: function( type, listener, useCapture ) {
|
||||||
if( 'addEventListener' in window ) {
|
if( 'addEventListener' in window ) {
|
||||||
( dom.wrapper || document.querySelector( '.reveal' ) ).addEventListener( type, listener, useCapture );
|
Reveal.getRevealElement().addEventListener( type, listener, useCapture );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeEventListener: function( type, listener, useCapture ) {
|
removeEventListener: function( type, listener, useCapture ) {
|
||||||
if( 'addEventListener' in window ) {
|
if( 'addEventListener' in window ) {
|
||||||
( dom.wrapper || document.querySelector( '.reveal' ) ).removeEventListener( type, listener, useCapture );
|
Reveal.getRevealElement().removeEventListener( type, listener, useCapture );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user