Change gc.lib.addCallback to gc.lib.pushCallback (#626)
This commit is contained in:
@@ -971,12 +971,12 @@
|
|||||||
pushEventListener( target, type, listenerFunction );
|
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.
|
// function to do arbitrary things.
|
||||||
var addCallback = function( callback ) {
|
var pushCallback = function( callback ) {
|
||||||
callbackList.push( callback );
|
callbackList.push( callback );
|
||||||
};
|
};
|
||||||
addCallback( function( rootId ) { resetStartingState( rootId ); } );
|
pushCallback( function( rootId ) { resetStartingState( rootId ); } );
|
||||||
|
|
||||||
// `teardown` will
|
// `teardown` will
|
||||||
// - execute all callbacks in LIFO order
|
// - execute all callbacks in LIFO order
|
||||||
@@ -1009,7 +1009,7 @@
|
|||||||
appendChild: appendChild,
|
appendChild: appendChild,
|
||||||
pushEventListener: pushEventListener,
|
pushEventListener: pushEventListener,
|
||||||
addEventListener: addEventListener,
|
addEventListener: addEventListener,
|
||||||
addCallback: addCallback,
|
pushCallback: pushCallback,
|
||||||
teardown: teardown
|
teardown: teardown
|
||||||
};
|
};
|
||||||
roots[ rootId ] = lib;
|
roots[ rootId ] = lib;
|
||||||
@@ -1294,7 +1294,7 @@
|
|||||||
addToolbarButton( toolbar );
|
addToolbarButton( toolbar );
|
||||||
}
|
}
|
||||||
|
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
clearTimeout( timeoutHandle );
|
clearTimeout( timeoutHandle );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@@ -1911,7 +1911,7 @@
|
|||||||
|
|
||||||
// Regster callback to empty the help div on teardown
|
// Regster callback to empty the help div on teardown
|
||||||
var api = e.detail.api;
|
var api = e.detail.api;
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
window.clearTimeout( timeoutHandle );
|
window.clearTimeout( timeoutHandle );
|
||||||
helpDiv.style.display = "";
|
helpDiv.style.display = "";
|
||||||
helpDiv.innerHTML = "";
|
helpDiv.innerHTML = "";
|
||||||
@@ -2728,7 +2728,7 @@
|
|||||||
|
|
||||||
// Unset all this on teardown
|
// Unset all this on teardown
|
||||||
var api = event.detail.api;
|
var api = event.detail.api;
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
document.body.classList.remove( "impress-mobile" );
|
document.body.classList.remove( "impress-mobile" );
|
||||||
var prev = document.getElementsByClassName( "prev" )[ 0 ];
|
var prev = document.getElementsByClassName( "prev" )[ 0 ];
|
||||||
var next = document.getElementsByClassName( "next" )[ 0 ];
|
var next = document.getElementsByClassName( "next" )[ 0 ];
|
||||||
@@ -2825,7 +2825,7 @@
|
|||||||
show();
|
show();
|
||||||
|
|
||||||
// Unset all this on teardown
|
// Unset all this on teardown
|
||||||
gc.addCallback( function() {
|
gc.pushCallback( function() {
|
||||||
window.clearTimeout( timeoutHandle );
|
window.clearTimeout( timeoutHandle );
|
||||||
document.body.classList.remove( "impress-mouse-timeout" );
|
document.body.classList.remove( "impress-mouse-timeout" );
|
||||||
} );
|
} );
|
||||||
@@ -3150,7 +3150,7 @@
|
|||||||
root = event.target;
|
root = event.target;
|
||||||
getSteps();
|
getSteps();
|
||||||
var gc = event.detail.api.lib.gc;
|
var gc = event.detail.api.lib.gc;
|
||||||
gc.addCallback( function() {
|
gc.pushCallback( function() {
|
||||||
stepids = [];
|
stepids = [];
|
||||||
if ( progressbar ) {
|
if ( progressbar ) {
|
||||||
progressbar.style.width = "";
|
progressbar.style.width = "";
|
||||||
@@ -3336,7 +3336,7 @@
|
|||||||
// Register teardown callback to reset the data.x, .y, .z values.
|
// Register teardown callback to reset the data.x, .y, .z values.
|
||||||
document.addEventListener( "impress:init", function( event ) {
|
document.addEventListener( "impress:init", function( event ) {
|
||||||
var root = event.target;
|
var root = event.target;
|
||||||
event.detail.api.lib.gc.addCallback( function() {
|
event.detail.api.lib.gc.pushCallback( function() {
|
||||||
var steps = startingState[ root.id ];
|
var steps = startingState[ root.id ];
|
||||||
var step;
|
var step;
|
||||||
while ( step = steps.pop() ) {
|
while ( step = steps.pop() ) {
|
||||||
@@ -3848,7 +3848,7 @@
|
|||||||
|
|
||||||
document.addEventListener( "impress:init", function( event ) {
|
document.addEventListener( "impress:init", function( event ) {
|
||||||
var api = event.detail.api;
|
var api = event.detail.api;
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
toolbar.innerHTML = "";
|
toolbar.innerHTML = "";
|
||||||
groups = [];
|
groups = [];
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -55,12 +55,12 @@
|
|||||||
pushEventListener( target, type, listenerFunction );
|
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.
|
// function to do arbitrary things.
|
||||||
var addCallback = function( callback ) {
|
var pushCallback = function( callback ) {
|
||||||
callbackList.push( callback );
|
callbackList.push( callback );
|
||||||
};
|
};
|
||||||
addCallback( function( rootId ) { resetStartingState( rootId ); } );
|
pushCallback( function( rootId ) { resetStartingState( rootId ); } );
|
||||||
|
|
||||||
// `teardown` will
|
// `teardown` will
|
||||||
// - execute all callbacks in LIFO order
|
// - execute all callbacks in LIFO order
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
appendChild: appendChild,
|
appendChild: appendChild,
|
||||||
pushEventListener: pushEventListener,
|
pushEventListener: pushEventListener,
|
||||||
addEventListener: addEventListener,
|
addEventListener: addEventListener,
|
||||||
addCallback: addCallback,
|
pushCallback: pushCallback,
|
||||||
teardown: teardown
|
teardown: teardown
|
||||||
};
|
};
|
||||||
roots[ rootId ] = lib;
|
roots[ rootId ] = lib;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
addToolbarButton( toolbar );
|
addToolbarButton( toolbar );
|
||||||
}
|
}
|
||||||
|
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
clearTimeout( timeoutHandle );
|
clearTimeout( timeoutHandle );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
// Regster callback to empty the help div on teardown
|
// Regster callback to empty the help div on teardown
|
||||||
var api = e.detail.api;
|
var api = e.detail.api;
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
window.clearTimeout( timeoutHandle );
|
window.clearTimeout( timeoutHandle );
|
||||||
helpDiv.style.display = "";
|
helpDiv.style.display = "";
|
||||||
helpDiv.innerHTML = "";
|
helpDiv.innerHTML = "";
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
// Unset all this on teardown
|
// Unset all this on teardown
|
||||||
var api = event.detail.api;
|
var api = event.detail.api;
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
document.body.classList.remove( "impress-mobile" );
|
document.body.classList.remove( "impress-mobile" );
|
||||||
var prev = document.getElementsByClassName( "prev" )[ 0 ];
|
var prev = document.getElementsByClassName( "prev" )[ 0 ];
|
||||||
var next = document.getElementsByClassName( "next" )[ 0 ];
|
var next = document.getElementsByClassName( "next" )[ 0 ];
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
show();
|
show();
|
||||||
|
|
||||||
// Unset all this on teardown
|
// Unset all this on teardown
|
||||||
gc.addCallback( function() {
|
gc.pushCallback( function() {
|
||||||
window.clearTimeout( timeoutHandle );
|
window.clearTimeout( timeoutHandle );
|
||||||
document.body.classList.remove( "impress-mouse-timeout" );
|
document.body.classList.remove( "impress-mouse-timeout" );
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
root = event.target;
|
root = event.target;
|
||||||
getSteps();
|
getSteps();
|
||||||
var gc = event.detail.api.lib.gc;
|
var gc = event.detail.api.lib.gc;
|
||||||
gc.addCallback( function() {
|
gc.pushCallback( function() {
|
||||||
stepids = [];
|
stepids = [];
|
||||||
if ( progressbar ) {
|
if ( progressbar ) {
|
||||||
progressbar.style.width = "";
|
progressbar.style.width = "";
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
// Register teardown callback to reset the data.x, .y, .z values.
|
// Register teardown callback to reset the data.x, .y, .z values.
|
||||||
document.addEventListener( "impress:init", function( event ) {
|
document.addEventListener( "impress:init", function( event ) {
|
||||||
var root = event.target;
|
var root = event.target;
|
||||||
event.detail.api.lib.gc.addCallback( function() {
|
event.detail.api.lib.gc.pushCallback( function() {
|
||||||
var steps = startingState[ root.id ];
|
var steps = startingState[ root.id ];
|
||||||
var step;
|
var step;
|
||||||
while ( step = steps.pop() ) {
|
while ( step = steps.pop() ) {
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
|
|
||||||
document.addEventListener( "impress:init", function( event ) {
|
document.addEventListener( "impress:init", function( event ) {
|
||||||
var api = event.detail.api;
|
var api = event.detail.api;
|
||||||
api.lib.gc.addCallback( function() {
|
api.lib.gc.pushCallback( function() {
|
||||||
toolbar.innerHTML = "";
|
toolbar.innerHTML = "";
|
||||||
groups = [];
|
groups = [];
|
||||||
} );
|
} );
|
||||||
|
|||||||
Reference in New Issue
Block a user