only call enter and leave events when necessary

This commit is contained in:
Bartek Szopka
2012-03-19 20:21:01 +00:00
parent b3d680eab4
commit fb32cf1bdd

View File

@@ -234,6 +234,7 @@
var onStepLeave = function (step) { var onStepLeave = function (step) {
if (lastEntered === step) { if (lastEntered === step) {
triggerEvent(step, "impress:stepleave"); triggerEvent(step, "impress:stepleave");
lastEntered = null;
} }
}; };
@@ -420,7 +421,7 @@
expectedTransitionTarget = target.scale > currentState.scale ? root : canvas; expectedTransitionTarget = target.scale > currentState.scale ? root : canvas;
if (activeStep) { if (activeStep && activeStep !== el) {
onStepLeave(activeStep); onStepLeave(activeStep);
} }