You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/js/views/bulk_edit_view.js

42 lines
972 B
JavaScript

/* global Whisper, */
// eslint-disable-next-line func-names
(function() {
'use strict';
window.Whisper = window.Whisper || {};
Whisper.BulkEditView = Whisper.View.extend({
initialize(options) {
this.selectedMessages = new Set();
this.render();
this.onCancel = options.onCancel;
this.onDelete = options.onDelete;
},
render() {
if (this.memberView) {
this.memberView.remove();
this.memberView = null;
}
this.memberView = new Whisper.ReactWrapperView({
className: 'bulk-edit-view',
Component: window.Signal.Components.BulkEdit,
props: {
messageCount: this.selectedMessages.size,
onCancel: this.onCancel,
onDelete: this.onDelete,
},
});
this.$el.append(this.memberView.el);
return this;
},
update(selectedMessages) {
this.selectedMessages = selectedMessages;
this.render();
},
});
})();