mirror of https://github.com/ColorlibHQ/AdminLTE
added toggled event to DirectChat.js
parent
c471db9628
commit
d6c8360f4f
|
@ -17,6 +17,10 @@ const DirectChat = (($) => {
|
|||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||
const DATA_API_KEY = '.data-api'
|
||||
|
||||
const Event = {
|
||||
TOGGLED: `toggled{EVENT_KEY}`
|
||||
}
|
||||
|
||||
const Selector = {
|
||||
DATA_TOGGLE: '[data-widget="chat-pane-toggle"]',
|
||||
DIRECT_CHAT: '.direct-chat'
|
||||
|
@ -38,6 +42,9 @@ const DirectChat = (($) => {
|
|||
|
||||
toggle() {
|
||||
$(this._element).parents(Selector.DIRECT_CHAT).first().toggleClass(ClassName.DIRECT_CHAT_OPEN);
|
||||
|
||||
const toggledEvent = $.Event(Event.TOGGLED)
|
||||
$(this._element).trigger(toggledEvent)
|
||||
}
|
||||
|
||||
// Static
|
||||
|
|
|
@ -33,3 +33,15 @@ $('#chat-pane-toggle').DirectChat('toggle')
|
|||
{: .table .table-bordered .bg-light}
|
||||
|
||||
Example: `$('#chat-pane-toggle').DirectChat('toggle')`
|
||||
|
||||
|
||||
##### Events
|
||||
{: .mt-4}
|
||||
|
||||
|---
|
||||
| Event Type | Description
|
||||
|-|-
|
||||
|toggled.lte.directchat | Triggered after a direct chat contacts pane is toggled.
|
||||
{: .table .table-bordered .bg-light}
|
||||
|
||||
Example: `$('#toggle-button').on('toggled.lte.directchat', handleToggledEvent)`
|
||||
|
|
Loading…
Reference in New Issue