Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
admin:online-platform-cms:using-web-ui-custom-events [2021/09/27 09:06] – evaldas-luksys | admin:online-platform-cms:using-web-ui-custom-events [2021/09/27 10:11] – evaldas-luksys | ||
---|---|---|---|
Line 129: | Line 129: | ||
| | ||
from: { | from: { | ||
- | fullPath: | + | fullPath: |
- | name: ' | + | name: string, |
}, | }, | ||
to: { | to: { | ||
- | fullPath: | + | fullPath: |
- | name: ' | + | name: string, |
} | } | ||
} | } | ||
Line 143: | Line 143: | ||
* routeChange fires this event before every route change, so we can react to changed routes with our custom script(s) added via Admin CMS section. | * routeChange fires this event before every route change, so we can react to changed routes with our custom script(s) added via Admin CMS section. | ||
- | * Use name from ' | + | * Use 'name' field from ' |
* This event allows custom script to stop the route change in the app by adding ' | * This event allows custom script to stop the route change in the app by adding ' | ||
* Each game has it's own module names, so Roulette page will fire ' | * Each game has it's own module names, so Roulette page will fire ' | ||
+ | * Games with nested URLs will have the same moduleName, but different names under the ' | ||
Script example and what it does: | Script example and what it does: | ||
* When user visits a page betgames-iframe, | * When user visits a page betgames-iframe, | ||
- | * Script prevents the route from changing, so user stays on the same route | + | * Script |
* User is shown a modal, with two buttons, 1 - Continue, 2 - Go back | * User is shown a modal, with two buttons, 1 - Continue, 2 - Go back | ||
- | * Continue button redirects user to another page (script builds custom | + | * Continue button redirects user to another page (script builds custom |
* Go back button will hide the popup and the user stays on the same route | * Go back button will hide the popup and the user stays on the same route | ||
Line 163: | Line 164: | ||
if (routeChangeEvent.detail.moduleName === ' | if (routeChangeEvent.detail.moduleName === ' | ||
+ | // 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) | ||
| | ||
| | ||
Line 196: | Line 199: | ||
modalElement.remove(); | modalElement.remove(); | ||
- | // If name is not set, it means that client came straight to this page through the URL section, so this is an exception and | + | // If name is not set, it means that client came straight to this page through the browsers address |
// should be handled differently, | // should be handled differently, | ||
if (!from.name) { | if (!from.name) { |