Permalink
Browse files

`goto` renamed to `step` to avoid code editor warnings and compressio…

…n/compilation errors
  • Loading branch information...
1 parent 028a298 commit e2b70b1cabc82158bb170c6546f189832ef177bc @bartaz committed Sep 3, 2012
Showing with 12 additions and 12 deletions.
  1. +12 −12 js/impress.js
View
@@ -225,7 +225,7 @@
if (!impressSupported) {
return {
init: empty,
- goto: empty,
+ step: empty,
prev: empty,
next: empty
};
@@ -418,9 +418,9 @@
// used to reset timeout for `impress:stepenter` event
var stepEnterTimeout = null;
- // `goto` API function that moves to step given with `el` parameter (by index, id or element),
+ // `step` API function that moves to step given with `el` parameter (by index, id or element),
// with a transition `duration` optionally given as second parameter.
- var goto = function ( el, duration ) {
+ var step = function ( el, duration ) {
if ( !initialized || !(el = getStep(el)) ) {
// presentation not initialized or given element is not a step
@@ -553,15 +553,15 @@
var prev = steps.indexOf( activeStep ) - 1;
prev = prev >= 0 ? steps[ prev ] : steps[ steps.length-1 ];
- return goto(prev);
+ return step(prev);
};
// `next` API function goes to next step (in document order)
var next = function () {
var next = steps.indexOf( activeStep ) + 1;
next = next < steps.length ? steps[ next ] : steps[ 0 ];
- return goto(next);
+ return step(next);
};
// Adding some useful classes to step elements.
@@ -615,25 +615,25 @@
window.addEventListener("hashchange", function () {
// When the step is entered hash in the location is updated
// (just few lines above from here), so the hash change is
- // triggered and we would call `goto` again on the same element.
+ // triggered and we would call `step` again on the same element.
//
// To avoid this we store last entered hash and compare.
if (window.location.hash !== lastHash) {
- goto( getElementFromHash() );
+ step( getElementFromHash() );
}
}, false);
// START
// by selecting step defined in url or first step of the presentation
- goto(getElementFromHash() || steps[0], 0);
+ step(getElementFromHash() || steps[0], 0);
}, false);
body.classList.add("impress-disabled");
// store and return API for given impress.js root element
return (roots[ "impress-root-" + rootId ] = {
init: init,
- goto: goto,
+ step: step,
next: next,
prev: prev
});
@@ -741,7 +741,7 @@
}
}
- if ( api.goto(target) ) {
+ if ( api.step(target) ) {
event.stopImmediatePropagation();
event.preventDefault();
}
@@ -756,7 +756,7 @@
target = target.parentNode;
}
- if ( api.goto(target) ) {
+ if ( api.step(target) ) {
event.preventDefault();
}
}, false);
@@ -784,7 +784,7 @@
// rescale presentation when window is resized
window.addEventListener("resize", throttle(function () {
// force going to active step again, to trigger rescaling
- api.goto( document.querySelector(".active"), 500 );
+ api.step( document.querySelector(".active"), 500 );
}, 250), false);
}, false);

0 comments on commit e2b70b1

Please sign in to comment.