()
| 8 | // eslint-disable-next-line promise/param-names |
| 9 | const loadZendesk = _.once(() => new Promise(function (accept, reject) { |
| 10 | const onLoad = function () { |
| 11 | // zE is the global variable created by the script. We never want the floating button to show, so we: |
| 12 | // 1: Hide it right away |
| 13 | // 2: Bind showing it to opening it |
| 14 | // 3: Bind closing it to hiding it |
| 15 | zE('webWidget', 'hide') |
| 16 | zE('webWidget:on', 'userEvent', function (event) { |
| 17 | if (event.action === 'Contact Form Shown') { |
| 18 | return zE('webWidget', 'open') |
| 19 | } |
| 20 | }) |
| 21 | zE('webWidget:on', 'close', () => zE('webWidget', 'hide')) |
| 22 | zE('webWidget', 'updateSettings', { |
| 23 | webWidget: { |
| 24 | offset: { horizontal: '100px', vertical: '20px' } |
| 25 | } |
| 26 | }) |
| 27 | return accept() |
| 28 | } |
| 29 | |
| 30 | const onError = function (e) { |
| 31 | console.error('Zendesk failed to initialize:', e) |
nothing calls this directly
no outgoing calls
no test coverage detected