remove action fix

This commit is contained in:
Yuri Kuznetsov
2024-06-19 21:36:35 +03:00
parent 02917943b6
commit 71f389703d
2 changed files with 29 additions and 7 deletions
+20 -2
View File
@@ -2962,8 +2962,26 @@ class DetailRecordView extends BaseRecordView {
}
}
if (this.isRendered()) {
this.$el.find('.detail-button-container .action[data-action="'+name+'"]').remove();
if (!this.isRendered()) {
return;
}
const $container = this.$el.find('.detail-button-container');
const $action = $container.find(`ul > li > a.action[data-action="${name}"]`);
if ($action.length) {
$action.parent().remove();
$container.find(`ul > .divider:last-child`).remove();
return;
}
const $button = $container.find(`button.action[data-action="${name}"]`);
if ($button.length) {
$button.remove();
}
}
+9 -5
View File
@@ -59,11 +59,15 @@ class CreateNoteStreamView extends NoteStreamView {
this.assignedUserName = data.assignedUserName || data.assignedUserId || null;
this.messageData['assignee'] =
$('<a>')
.attr('href', `#User/view/${this.assignedUserId}`)
.text(this.assignedUserName)
.attr('data-scope', 'User')
.attr('data-id', this.assignedUserId);
$('<span>')
.append(
this.getHelper().getAvatarHtml(data.assignedUserId, 'small', 16, 'avatar-link'),
$('<a>')
.attr('href', `#User/view/${this.assignedUserId}`)
.text(this.assignedUserName)
.attr('data-scope', 'User')
.attr('data-id', this.assignedUserId)
);
let isYou = false;