import RytmWebflow from 'rytm-webflow' import { trace } from 'rytm-helpers' import { WCAG } from "rytm-wcag" import { windowUpdate, removeReCaptchaBadge } from './shared/common' // controllers import Controller from './controllers/Controller' // views // import View from './views/View' const routes = { 'webflow': { controller: Controller, view: RytmWebflow.WebflowView }, 'list': { controller: Controller, view: RytmWebflow.WebflowListView }, } const aswapProps = { animationTimeHide: 800, animationTimeShow: 800, preloadOnHover: false, cacheOn: true, refreshOnSameUrl: false, routes, trace, } const aswapEvents = { onViewSwapComplete: () => { WCAG.dialogCloseAll() windowUpdate() }, onViewHide: () => { WCAG.dialogCloseAll() removeReCaptchaBadge() }, onViewHidden: () => { // destroy... }, onRequestSameUrl: () => { // same url request }, } export const initASwap = () => { RytmWebflow.aswap.init(aswapProps, aswapEvents) }