admin:online-platform-cms:using-web-ui-custom-events

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
admin:online-platform-cms:using-web-ui-custom-events [2021/09/27 09:13] evaldas-luksysadmin:online-platform-cms:using-web-ui-custom-events [2021/09/27 10:11] evaldas-luksys
Line 129: Line 129:
  moduleName: 'prematch',  moduleName: 'prematch',
  from: {  from: {
-  fullPath: '/app/en/prematch/9500/football'+  fullPath: string
-  name: 'prematch.sportName',+  name: string,
  },  },
  to: {  to: {
-  fullPath: '/app/en/roulettes/roulette/3'+  fullPath: string
-  name: 'roulettes.roulette',+  name: string,
  }  }
 } }
Line 146: Line 146:
   * This event allows custom script to stop the route change in the app by adding 'Event.preventDefault()' in the event's listener.   * This event allows custom script to stop the route change in the app by adding 'Event.preventDefault()' in the event's listener.
   * Each game has it's own module names, so Roulette page will fire 'roulette' and Dogs page 'dogs' modaleNames.   * Each game has it's own module names, so Roulette page will fire 'roulette' and Dogs page 'dogs' modaleNames.
 +  * Games with nested URLs will have the same moduleName, but different names under the 'from' and 'to' objects.
    
 Script example and what it does: Script example and what it does:
Line 163: Line 164:
  
    if (routeChangeEvent.detail.moduleName === 'betgames-iframe') {    if (routeChangeEvent.detail.moduleName === 'betgames-iframe') {
 +       // preventDefault prevents the route from updating, so the user cannot access this page normally as he would. In this case
 +       // we provide our custom solution to guide user when he tries to visit this module (page)
        routeChangeEvent.preventDefault();        routeChangeEvent.preventDefault();
        displayBetGamesModal(routeChangeEvent.detail.to, routeChangeEvent.detail.from);        displayBetGamesModal(routeChangeEvent.detail.to, routeChangeEvent.detail.from);
  • admin/online-platform-cms/using-web-ui-custom-events.txt
  • Last modified: 2021/09/27 10:11
  • (external edit)