Change gc.lib.addCallback to gc.lib.pushCallback (#626)

This commit is contained in:
Henrik Ingo
2017-11-01 15:00:03 +02:00
parent 2d229bf4a6
commit d6c6cd47c2
9 changed files with 22 additions and 22 deletions

View File

@@ -55,12 +55,12 @@
pushEventListener( target, type, listenerFunction );
};
// `addCallback` If the above utilities are not enough, plugins can add their own callback
// `pushCallback` If the above utilities are not enough, plugins can add their own callback
// function to do arbitrary things.
var addCallback = function( callback ) {
var pushCallback = function( callback ) {
callbackList.push( callback );
};
addCallback( function( rootId ) { resetStartingState( rootId ); } );
pushCallback( function( rootId ) { resetStartingState( rootId ); } );
// `teardown` will
// - execute all callbacks in LIFO order
@@ -93,7 +93,7 @@
appendChild: appendChild,
pushEventListener: pushEventListener,
addEventListener: addEventListener,
addCallback: addCallback,
pushCallback: pushCallback,
teardown: teardown
};
roots[ rootId ] = lib;

View File

@@ -41,7 +41,7 @@
addToolbarButton( toolbar );
}
api.lib.gc.addCallback( function() {
api.lib.gc.pushCallback( function() {
clearTimeout( timeoutHandle );
} );

View File

@@ -105,7 +105,7 @@
// Regster callback to empty the help div on teardown
var api = e.detail.api;
api.lib.gc.addCallback( function() {
api.lib.gc.pushCallback( function() {
window.clearTimeout( timeoutHandle );
helpDiv.style.display = "";
helpDiv.innerHTML = "";

View File

@@ -51,7 +51,7 @@
// Unset all this on teardown
var api = event.detail.api;
api.lib.gc.addCallback( function() {
api.lib.gc.pushCallback( function() {
document.body.classList.remove( "impress-mobile" );
var prev = document.getElementsByClassName( "prev" )[ 0 ];
var next = document.getElementsByClassName( "next" )[ 0 ];

View File

@@ -58,7 +58,7 @@
show();
// Unset all this on teardown
gc.addCallback( function() {
gc.pushCallback( function() {
window.clearTimeout( timeoutHandle );
document.body.classList.remove( "impress-mouse-timeout" );
} );

View File

@@ -19,7 +19,7 @@
root = event.target;
getSteps();
var gc = event.detail.api.lib.gc;
gc.addCallback( function() {
gc.pushCallback( function() {
stepids = [];
if ( progressbar ) {
progressbar.style.width = "";

View File

@@ -146,7 +146,7 @@
// Register teardown callback to reset the data.x, .y, .z values.
document.addEventListener( "impress:init", function( event ) {
var root = event.target;
event.detail.api.lib.gc.addCallback( function() {
event.detail.api.lib.gc.pushCallback( function() {
var steps = startingState[ root.id ];
var step;
while ( step = steps.pop() ) {

View File

@@ -147,7 +147,7 @@
document.addEventListener( "impress:init", function( event ) {
var api = event.detail.api;
api.lib.gc.addCallback( function() {
api.lib.gc.pushCallback( function() {
toolbar.innerHTML = "";
groups = [];
} );