Fixes #2628: Open bookmarks toggle emits an error
This commit is contained in:
parent
b75e67fafa
commit
f04a376653
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 8.0.1 (Unreleased)
|
## 8.0.1 (Unreleased)
|
||||||
|
|
||||||
|
- #2628: Open groupchats toggle emits an error
|
||||||
|
- #2629: OMEMO button tooltip is wrong in private chat
|
||||||
- #2634: Image previews not loading when not serving Converse locally
|
- #2634: Image previews not loading when not serving Converse locally
|
||||||
|
|
||||||
## 8.0.0 (2021-09-03)
|
## 8.0.0 (2021-09-03)
|
||||||
|
1
package-lock.json
generated
1
package-lock.json
generated
@ -5,7 +5,6 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "converse.js",
|
|
||||||
"version": "8.0.0",
|
"version": "8.0.0",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -39,9 +39,7 @@ export default class BookmarksView extends ElementView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleBookmarksList (ev) {
|
toggleBookmarksList (ev) {
|
||||||
if (ev && ev.preventDefault) {
|
ev?.preventDefault?.();
|
||||||
ev.preventDefault();
|
|
||||||
}
|
|
||||||
const icon_el = ev.target.matches('.fa') ? ev.target : ev.target.querySelector('.fa');
|
const icon_el = ev.target.matches('.fa') ? ev.target : ev.target.querySelector('.fa');
|
||||||
if (u.hasClass('fa-caret-down', icon_el)) {
|
if (u.hasClass('fa-caret-down', icon_el)) {
|
||||||
u.slideIn(this.querySelector('.bookmarks'));
|
u.slideIn(this.querySelector('.bookmarks'));
|
||||||
|
23
src/plugins/roomslist/model.js
Normal file
23
src/plugins/roomslist/model.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { Model } from '@converse/skeletor/src/model.js';
|
||||||
|
import { _converse, api, converse } from "@converse/headless/core";
|
||||||
|
|
||||||
|
const { Strophe } = converse.env;
|
||||||
|
|
||||||
|
const RoomsListModel = Model.extend({
|
||||||
|
defaults: function () {
|
||||||
|
return {
|
||||||
|
'muc_domain': api.settings.get('muc_domain'),
|
||||||
|
'nick': _converse.getDefaultMUCNickname(),
|
||||||
|
'toggle-state': _converse.OPENED,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
setDomain (jid) {
|
||||||
|
if (!api.settings.get('locked_muc_domain')) {
|
||||||
|
this.save('muc_domain', Strophe.getDomainFromJid(jid));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default RoomsListModel;
|
||||||
|
|
@ -1,32 +1,13 @@
|
|||||||
import RoomDetailsModal from 'modals/muc-details.js';
|
import RoomDetailsModal from 'modals/muc-details.js';
|
||||||
import tpl_roomslist from "./templates/roomslist.js";
|
import tpl_roomslist from "./templates/roomslist.js";
|
||||||
import { ElementView } from '@converse/skeletor/src/element.js';
|
import { ElementView } from '@converse/skeletor/src/element.js';
|
||||||
import { Model } from '@converse/skeletor/src/model.js';
|
import RoomsListModel from './model.js';
|
||||||
import { __ } from 'i18n';
|
import { __ } from 'i18n';
|
||||||
import { _converse, api, converse } from "@converse/headless/core";
|
import { _converse, api, converse } from "@converse/headless/core";
|
||||||
import { initStorage } from '@converse/headless/utils/storage.js';
|
import { initStorage } from '@converse/headless/utils/storage.js';
|
||||||
import { render } from 'lit';
|
import { render } from 'lit';
|
||||||
|
|
||||||
const { Strophe } = converse.env;
|
const { Strophe, u } = converse.env;
|
||||||
const u = converse.env.utils;
|
|
||||||
|
|
||||||
|
|
||||||
const RoomsListModel = Model.extend({
|
|
||||||
defaults: function () {
|
|
||||||
return {
|
|
||||||
'muc_domain': api.settings.get('muc_domain'),
|
|
||||||
'nick': _converse.getDefaultMUCNickname(),
|
|
||||||
'toggle-state': _converse.OPENED,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
setDomain (jid) {
|
|
||||||
if (!api.settings.get('locked_muc_domain')) {
|
|
||||||
this.save('muc_domain', Strophe.getDomainFromJid(jid));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
export class RoomsList extends ElementView {
|
export class RoomsList extends ElementView {
|
||||||
|
|
||||||
@ -109,16 +90,16 @@ export class RoomsList extends ElementView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleRoomsList (ev) {
|
toggleRoomsList (ev) {
|
||||||
if (ev && ev.preventDefault) { ev.preventDefault(); }
|
ev?.preventDefault?.();
|
||||||
const icon_el = ev.target.matches('.fa') ? ev.target : ev.target.querySelector('.fa');
|
const icon_el = ev.target.matches('.fa') ? ev.target : ev.target.querySelector('.fa');
|
||||||
if (icon_el.classList.contains("fa-caret-down")) {
|
if (icon_el.classList.contains("fa-caret-down")) {
|
||||||
u.slideIn(this.el.querySelector('.open-rooms-list')).then(() => {
|
u.slideIn(this.querySelector('.open-rooms-list')).then(() => {
|
||||||
this.model.save({'toggle-state': _converse.CLOSED});
|
this.model.save({'toggle-state': _converse.CLOSED});
|
||||||
icon_el.classList.remove("fa-caret-down");
|
icon_el.classList.remove("fa-caret-down");
|
||||||
icon_el.classList.add("fa-caret-right");
|
icon_el.classList.add("fa-caret-right");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
u.slideOut(this.el.querySelector('.open-rooms-list')).then(() => {
|
u.slideOut(this.querySelector('.open-rooms-list')).then(() => {
|
||||||
this.model.save({'toggle-state': _converse.OPENED});
|
this.model.save({'toggle-state': _converse.OPENED});
|
||||||
icon_el.classList.remove("fa-caret-right");
|
icon_el.classList.remove("fa-caret-right");
|
||||||
icon_el.classList.add("fa-caret-down");
|
icon_el.classList.add("fa-caret-down");
|
||||||
|
Loading…
Reference in New Issue
Block a user