imports/vx/client/code/ux.js
/**
     * Pop the iOS button stack, and set the new state accordingly. If we're at the top of the stack, we'll
     * programmatically trigger the standard back function.
     *
     * @param {string} animation Optional animation name.
     */
Pop the iOS button stack, and set the new state accordingly. If we're at the top of the stack, we'll
programmatically trigger the standard back function.

@param {string} animation Optional animation name.
Pop the iOS button stack and set the new state accordingly . If we ' re at the top of the stack we ' ll programmatically trigger the standard back function . @param { string } animation Optional animation name .
iosPopAndGo(animation) {
        animation = animation || "slideright"
        const path = Util.routePath()
        const iosState = { ...Store.getState().iosState }
        if (!iosState.stack || iosState.stack.length === 0) {
            OLog.error("ux.js iosPopAndGo stack length is zero, cannot pop")
            UX.goDefault()
            return
        }
        let state
        if (UX.isSlideMode()) {
            state = iosState.stack.pop()
        }
        else {
            do {
                state = iosState.stack.pop()
            }
            while (state && !state.major)
        }
        if (!state) {
            OLog.error("ux.js iosPopAndGo pop executed but no previous state exists on stack going to default route")
            UX.goDefault()
            return
        }
        OLog.debug(`ux.js iosPopAndGo stack *pop* new state=${OLog.debugString(state)}`)
        Meteor.setTimeout(() => {
            try {
                UX.lockExitingComponents(true)
                iosState.majorBackLabel = state.majorLabel
                iosState.minorBackLabel = state.minorLabel
                UX.beforeAnimate()
                if (state.major) {
                    UX.setAnimation("vx-layout-standard", animation)
                }
                else {
                    UX.setAnimation("vx-slide-pair", animation)
                }
                UX.mutatePanelMap(iosState, state.path, state.panel)
                Store.dispatch(setIosState(iosState))
                if (path === state.path) {
                    OLog.debug(`ux.js iosPopAndGo original path=${path} state.path=${state.path} *same* stay on this route`)
                    return
                }
                OLog.debug(`ux.js iosPopAndGo original path=${path} state.path=${state.path} *different* go ${state.path}`)
                Meteor.setTimeout(() => {
                    UX.go(state.path)
                })
            }
            catch (error) {
                OLog.debug(`ux.js iosPopAndGo error=${error}`)
            }
        })
    }
iosPopAndGo ( animation ) { animation = animation || "slideright" const path = Util . routePath ( ) const iosState = { ... Store . getState ( ) . iosState } if ( ! iosState . stack || iosState . stack . length === 0 ) { OLog . error ( "ux.js iosPopAndGo stack length is zero, cannot pop" ) UX . goDefault ( ) return } let state if ( UX . isSlideMode ( ) ) { state = iosState . stack . pop ( ) } else { do { state = iosState . stack . pop ( ) } while ( state && ! state . major ) } if ( ! state ) { OLog . error ( "ux.js iosPopAndGo pop executed but no previous state exists on stack going to default route" ) UX . goDefault ( ) return } OLog . debug ( ` ${ OLog . debugString ( state ) } ` ) Meteor . setTimeout ( ( ) => { try { UX . lockExitingComponents ( true ) iosState . majorBackLabel = state . majorLabel iosState . minorBackLabel = state . minorLabel UX . beforeAnimate ( ) if ( state . major ) { UX . setAnimation ( "vx-layout-standard" , animation ) } else { UX . setAnimation ( "vx-slide-pair" , animation ) } UX . mutatePanelMap ( iosState , state . path , state . panel ) Store . dispatch ( setIosState ( iosState ) ) if ( path === state . path ) { OLog . debug ( ` ${ path } ${ state . path } ` ) return } OLog . debug ( ` ${ path } ${ state . path } ${ state . path } ` ) Meteor . setTimeout ( ( ) => { UX . go ( state . path ) } ) } catch ( error ) { OLog . debug ( ` ${ error } ` ) } } ) }
Pop the iOS button stack, and set the new state accordingly.
Pop the iOS button stack and set the new state accordingly .