mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-54687 core_message: remove contact from DOM if no messages remain
This commit is contained in:
parent
6d3445de77
commit
d29cdf3a1f
1 changed files with 6 additions and 0 deletions
|
@ -297,6 +297,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
|
|||
}
|
||||
}.bind(this));
|
||||
|
||||
// If there are no messages at all, then remove conversation panel.
|
||||
if (this.messageArea.find(this.messageArea.SELECTORS.MESSAGE).length === 0) {
|
||||
this.messageArea.find(this.messageArea.SELECTORS.CONVERSATIONS + " " +
|
||||
this.messageArea.SELECTORS.CONTACT + "[data-userid='" + this._getUserId() + "']").remove();
|
||||
}
|
||||
|
||||
// Trigger event letting other modules know messages were deleted.
|
||||
this.messageArea.trigger(this.messageArea.EVENTS.MESSAGESDELETED, this._getUserId());
|
||||
}.bind(this), notification.exception);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue