Skip to content

Commit

Permalink
fix error message on removing bulk actions from search, closes #3027
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Jul 30, 2022
1 parent 6c43b92 commit c727a2b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions src/public/app/widgets/dialogs/bulk_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ import server from "../../services/server.js";
import toastService from "../../services/toast.js";

const TPL = `
<div class="bulk-assign-attributes-dialog modal mx-auto" tabindex="-1" role="dialog">
<div class="bulk-actions-dialog modal mx-auto" tabindex="-1" role="dialog">
<style>
.bulk-assign-attributes-dialog .modal-body h4:not(:first-child) {
.bulk-actions-dialog .modal-body h4:not(:first-child) {
margin-top: 20px;
}
.bulk-assign-attributes-dialog .bulk-available-action-list button {
.bulk-actions-dialog .bulk-available-action-list button {
padding: 2px 7px;
margin-right: 10px;
margin-bottom: 5px;
}
.bulk-assign-attributes-dialog .bulk-existing-action-list {
.bulk-actions-dialog .bulk-existing-action-list {
width: 100%;
}
.bulk-assign-attributes-dialog .bulk-existing-action-list td {
.bulk-actions-dialog .bulk-existing-action-list td {
padding: 7px;
}
.bulk-assign-attributes-dialog .bulk-existing-action-list .button-column {
.bulk-actions-dialog .bulk-existing-action-list .button-column {
/* minimal width so that table remains static sized and most space remains for middle column with settings */
width: 50px;
white-space: nowrap;
Expand Down Expand Up @@ -147,8 +147,16 @@ export default class BulkActionsDialog extends BasicWidget {

entitiesReloadedEvent({loadResults}) {
// only refreshing deleted attrs, otherwise components update themselves
if (loadResults.getAttributes().find(attr => attr.type === 'label' && attr.name === 'action' && attr.isDeleted)) {
this.refresh();
if (loadResults.getAttributes().find(attr =>
attr.type === 'label'
&& attr.name === 'action'
&& attr.noteId === 'bulkaction'
&& attr.isDeleted)) {

// this may be triggered from e.g. sync without open widget, then no need to refresh the widget
if (this.selectedOrActiveNoteIds && this.$widget.is(":visible")) {
this.refresh();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/public/app/widgets/mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class MermaidWidget extends NoteContextAwareWidget {
}

download(filename, text) {
var element = document.createElement('a');
const element = document.createElement('a');
element.setAttribute('href', 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);

Expand Down

0 comments on commit c727a2b

Please sign in to comment.