Winwheel.js
function winwheelStopAnimation(canCallback)
{
    // When the animation is stopped if canCallback is not false then try to call the callback.
    // false can be passed in to stop the after happening if the animation has been stopped before it ended normally.
    if (canCallback != false) {
        let callback = winwheelToDrawDuringAnimation.animation.callbackFinished;

        if (callback != null) {
            // If the callback is a function then call it, otherwise evaluate the property as javascript code.
            if (typeof callback === 'function') {
                // Pass back the indicated segment as 99% of the time you will want to know this to inform the user of their prize.
                callback(winwheelToDrawDuringAnimation.getIndicatedSegment());
            } else {
                eval(callback);
            }
        }
    }
}
function winwheelStopAnimation(canCallback)
{
    // When the animation is stopped if canCallback is not false then try to call the callback.
    // false can be passed in to stop the after happening if the animation has been stopped before it ended normally.
    if (canCallback != false) {
        let callback = winwheelToDrawDuringAnimation.animation.callbackFinished;

        if (callback != null) {
            // If the callback is a function then call it, otherwise evaluate the property as javascript code.
            if (typeof callback === 'function') {
                // Pass back the indicated segment as 99% of the time you will want to know this to inform the user of their prize.
                callback(winwheelToDrawDuringAnimation.getIndicatedSegment());
            } else {
                eval(callback);
            }
        }
    }
}
function winwheelStopAnimation ( canCallback ) { // When the animation is stopped if canCallback is not false then try to call the callback. // false can be passed in to stop the after happening if the animation has been stopped before it ended normally. if ( canCallback != false ) { let callback = winwheelToDrawDuringAnimation . animation . callbackFinished ; if ( callback != null ) { // If the callback is a function then call it, otherwise evaluate the property as javascript code. if ( typeof callback === 'function' ) { // Pass back the indicated segment as 99% of the time you will want to know this to inform the user of their prize. callback ( winwheelToDrawDuringAnimation . getIndicatedSegment ( ) ) ; } else { eval ( callback ) ; } } } }
This global is set by the winwheel class to the wheel object to be re-drawn.
This global is set by the winwheel class to the wheel object to be re - drawn .