|
21 | 21 | </style> |
22 | 22 |
|
23 | 23 |
|
24 | | -<style> |
25 | | - .agentforce-messaging > .agentforce-messaging-frame[class~="initial"], |
26 | | - .agentforce-messaging > .agentforce-messaging-frame[class~="minimized"], |
27 | | - .custom-fab |
28 | | - { |
29 | | - display: none; |
30 | | - } |
31 | | - |
32 | | - .custom-fab { |
33 | | - position: fixed; |
34 | | - bottom: 24px; |
35 | | - right: 24px; |
36 | | - } |
37 | | - |
38 | | - /* mobile phones (240px-767px) */ |
39 | | - @media only screen and (min-width: 15em) and (max-width: 47.9375em) { |
40 | | - /* do not allow background clicks or scrolling on mobile devices when client is maximized */ |
41 | | - .prevent-background-scrolling { |
42 | | - overflow: hidden; |
43 | | - cursor: none; |
44 | | - } |
45 | | - } |
46 | | - |
47 | | -</style> |
48 | | - |
49 | | - |
50 | 24 | <div class="background-container"> |
51 | 25 | <img src="https://esw1234.github.io/wsi.png" alt="Background"> |
52 | 26 | </div> |
53 | 27 |
|
54 | 28 | <button type="button" class="custom-fab" onclick="onCustomFabClick()">my custom fab</button> |
55 | 29 |
|
56 | 30 | <script type="text/javascript"> |
57 | | - window.addEventListener("onEmbeddedMessagingReady", (event) => { |
58 | | - document.querySelector(".custom-fab").style.display = "block"; |
59 | | - }); |
60 | | - window.addEventListener("onEmbeddedMessagingWindowMaximized", (event) => { |
61 | | - document.querySelector(".custom-fab").style.display = "none"; |
62 | | - document.body.classList.add("prevent-background-scrolling"); |
63 | | - }); |
64 | | - |
65 | | - window.addEventListener("onEmbeddedMessagingWindowMinimized", (event) => { |
66 | | - document.querySelector(".custom-fab").style.display = "block"; |
67 | | - document.body.classList.remove("prevent-background-scrolling"); |
68 | | - }); |
69 | | - |
70 | | - function onCustomFabClick() { |
71 | | - embeddedservice_bootstrap.utilAPI.launchChat(); |
72 | | - } |
73 | 31 | function initEmbeddedMessaging() { |
74 | 32 | try { |
75 | 33 | embeddedservice_bootstrap.settings.language = 'en_US'; // For example, enter 'en' or 'en-US' |
|
0 commit comments