MCPcopy Create free account
hub / github.com/codecombat/codecombat / onLoad

Function onLoad

app/core/services/zendesk.js:10–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8// eslint-disable-next-line promise/param-names
9const 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)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected