element check cleanup

This commit is contained in:
Yuri Kuznetsov
2025-03-18 16:42:05 +02:00
parent 2a2e0cc15d
commit a71bf16c51
4 changed files with 8 additions and 26 deletions
-4
View File
@@ -90,10 +90,6 @@ class EmailBodyFieldView extends WysiwygFieldView {
afterRender() {
super.afterRender();
if (!this.element) {
return;
}
this.controlInsertFieldButton();
if (this.isReadMode() && this.replyPart) {
+4 -6
View File
@@ -385,13 +385,11 @@ class TextFieldView extends BaseFieldView {
this.controlSeeMore();
});
// Can be hidden.
// @todo Revise stream post with empty text.
if (this.element) {
this.element.querySelectorAll('img').forEach(image => {
image.addEventListener('load', this.controlSeeMoreBind);
});
}
this.element.querySelectorAll('img').forEach(image => {
image.addEventListener('load', this.controlSeeMoreBind);
});
}
}
+4 -11
View File
@@ -141,6 +141,10 @@ class VarcharFieldView extends BaseFieldView {
this.events['click [data-action="copyToClipboard"]'] = () => this.copyToClipboard();
}
}
this.on('remove', () => {
this.searchMultiSelectInputElement = undefined;
});
}
/**
@@ -269,11 +273,6 @@ class VarcharFieldView extends BaseFieldView {
* @param {string} type
*/
handleSearchType(type) {
if (!this.element) {
// @todo Remove when handled by bullbone.
return;
}
const mainElement = this.element.querySelector('input.main-element');
const multiSelectContainer = this.element.querySelector('div[data-role="multi-select-container"]');
@@ -533,12 +532,6 @@ class VarcharFieldView extends BaseFieldView {
* @private
*/
initSearchMultiSelect() {
if (!this.element) {
this.searchMultiSelectInputElement = undefined;
return;
}
this.searchMultiSelectInputElement = this.element.querySelector('input[data-role="multi-select-input"]');
MultiSelect.init(this.searchMultiSelectInputElement, {
-5
View File
@@ -222,11 +222,6 @@ class ImagePreviewModalView extends ModalView {
}
afterRender() {
if (!this.element) {
// @todo Remove when views are not rendered, after change in bull.
return;
}
if (this.isMultiple()) {
/** @type {HTMLDivElement|null} */
const titleElement = this.dialog.getElement().querySelector('.modal-header .modal-title');