Skip to content

Commit

Permalink
fix lock icon on templates not getting updated correctly. fix #4388
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Jun 10, 2023
1 parent 544a5d0 commit a490c93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/templates/view-edit-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{% endif %}

{# RIGHT PART #}
<div class='ml-auto d-flex align-items-center'>
<div class='ml-auto d-flex align-items-center' id='toolbarRightDiv'>
{# TOGGLE PIN #}
<div class='mr-2'>
<div title='{{ 'Toggle pin (add to create button menu)'|trans }}' data-action='toggle-pin' data-id='{{ Entity.id }}' id='toggle-pin-icon-div' class='{{ Entity.Pins.isPinned ? 'bgnd-gray' : 'hl-hover-gray' }} p-2 rounded'>
Expand Down
10 changes: 2 additions & 8 deletions src/ts/ucp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @license AGPL-3.0
* @package elabftw
*/
import { getEntity, notif, reloadElement, addAutocompleteToTagInputs, collectForm } from './misc';
import { getEntity, notif, reloadElement, collectForm } from './misc';
import tinymce from 'tinymce/tinymce';
import { getTinymceBaseConfig } from './tinymce';
import i18next from 'i18next';
Expand Down Expand Up @@ -64,13 +64,7 @@ document.addEventListener('DOMContentLoaded', () => {
}
// LOCK TEMPLATE
} else if (el.matches('[data-action="toggle-lock"]')) {
EntityC.lock(parseInt(el.dataset.id)).then(() => {
reloadElement('templatesDiv').then(() => {
addAutocompleteToTagInputs();
tinymce.remove();
tinymce.init(getTinymceBaseConfig('ucp'));
});
});
EntityC.lock(parseInt(el.dataset.id)).then(() => reloadElement('toolbarRightDiv'));
// UPDATE TEMPLATE
} else if (el.matches('[data-action="update-template"]')) {
EntityC.update(entity.id, Target.Body, editor.getContent());
Expand Down

0 comments on commit a490c93

Please sign in to comment.