2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Refactor notes for "purchase order"

This commit is contained in:
Oliver Walters
2022-04-10 19:55:32 +10:00
parent df9c5c0048
commit 1c60d4e152
3 changed files with 70 additions and 77 deletions

View File

@ -239,7 +239,7 @@ function setupNotesField(element, url, options={}) {
});
var toolbar_icons = [
'preview',
'preview', '|',
];
if (editable) {
@ -266,14 +266,14 @@ function setupNotesField(element, url, options={}) {
shortcuts: [],
});
// Hide the toolbar
$(`#${element}`).next('.EasyMDEContainer').find('.editor-toolbar').hide();
if (!editable) {
// Set readonly
mde.codemirror.setOption('readOnly', true);
// Hide the toolbar
$(`#${element}`).next('.EasyMDEContainer').find('.editor-toolbar').hide();
// Hide the "edit" and "save" buttons
$('#edit-notes').hide();
$('#save-notes').hide();
@ -286,6 +286,9 @@ function setupNotesField(element, url, options={}) {
$('#edit-notes').hide();
$('#save-notes').show();
// Show the toolbar
$(`#${element}`).next('.EasyMDEContainer').find('.editor-toolbar').show();
mde.togglePreview();
});