xmpp.chapril.org-conversejs/src/plugins/profile/statusview.js
JC Brand 15c10376b0 Rename all templates to camelCase
To conform with naming conventions regarding functions, which the
templates are.
2023-02-15 14:29:07 +01:00

34 lines
1.1 KiB
JavaScript

import tplProfile from './templates/profile.js';
import { CustomElement } from 'shared/components/element.js';
import { _converse, api } from '@converse/headless/core';
class Profile extends CustomElement {
initialize () {
this.model = _converse.xmppstatus;
this.listenTo(this.model, "change", () => this.requestUpdate());
this.listenTo(this.model, "vcard:add", () => this.requestUpdate());
this.listenTo(this.model, "vcard:change", () => this.requestUpdate());
}
render () {
return tplProfile(this);
}
showProfileModal (ev) {
ev?.preventDefault();
api.modal.show('converse-profile-modal', { model: this.model }, ev);
}
showStatusChangeModal (ev) {
ev?.preventDefault();
api.modal.show('converse-chat-status-modal', { model: this.model }, ev);
}
showUserSettingsModal (ev) {
ev?.preventDefault();
api.modal.show('converse-user-settings-modal', { model: this.model, _converse }, ev);
}
}
api.elements.define('converse-user-profile', Profile);