You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+25-16Lines changed: 25 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,21 +26,22 @@ In this documentation, _Web Chat_ refers to the chat widget; _your assistant_ re
26
26
-[instance.toggleOpen()](#instancetoggleopen)
27
27
-[instance.openWindow()](#instanceopenwindow)
28
28
-[instance.closeWindow()](#instanceclosewindow)
29
+
-[instance.doAutoScroll()](#instanceDoAutoScroll)
29
30
-[instance.destroy()](#instancedestroy)
30
31
-[Events](#events)
31
32
-[Events summary](#events-summary)
32
33
-[Event callbacks](#event-callbacks)
33
34
-[Managing Context](#managing-context)
34
35
-[Event details](#event-details)
35
-
-[pre:send](#presend)
36
-
-[send](#send)
37
-
-[pre:receive](#prereceive)
38
-
-[receive](#receive)
39
-
-[error](#error)
40
-
-[customResponse](#customresponse)
41
-
-[window:open](#windowopen)
42
-
-[window:close](#windowclose)
43
-
-[Wildcard (*)](#wildcard)
36
+
-[`pre:send`](#presend)
37
+
-[`send`](#send)
38
+
-[`pre:receive`](#prereceive)
39
+
-[`receive`](#receive)
40
+
-[`error`](#error)
41
+
-[`customResponse`](#customresponse)
42
+
-[`window:open`](#windowopen)
43
+
-[`window:close`](#windowclose)
44
+
-[Wildcard (`*`)](#wildcard)
44
45
45
46
## Key Concepts
46
47
@@ -68,16 +69,14 @@ If the last two versions of a browser add up to more than 1% of all web traffic
68
69
When you create a Web Chat integration in the Watson Assistant UI, you are given a small embed code to add to your website that looks similar to this example:
integrationID:'YOUR_INTEGRATION_ID', // A UUID like '1d7e34d5-3952-4b86-90eb-7c7232b9b540'
@@ -392,6 +391,16 @@ Closes the chat window if it is currently open, and fires the [`window:close`](#
392
391
instance.closeWindow();
393
392
```
394
393
394
+
<aname="instance.doAutoScroll"></a>
395
+
### instance.doAutoScroll()
396
+
Requests the current messages list to auto-scroll to the bottom. The scrolling will scroll to the last set of messages
397
+
from either the user or from the bot.
398
+
399
+
**Example**
400
+
```js
401
+
instance.doAutoScroll();
402
+
```
403
+
395
404
<aname="instance.destroy"></a>
396
405
### instance.destroy()
397
406
Destroy the Web Chat widget and return initial content to the DOM. The chat window and chat launcher are both destroyed. All subscriptions to events are removed.
@@ -417,7 +426,7 @@ action that triggered the event stops and no additional event handlers will be c
0 commit comments