Working file loading!
This commit is contained in:
@@ -33,9 +33,29 @@ export const FileViewer = Node.create<FileViewerOptions>({
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
jobId: { default: null },
|
||||
collectionId: { default: 'Job_Info_Prod' },
|
||||
filename: { default: null },
|
||||
jobId: {
|
||||
default: null,
|
||||
parseHTML: element => element.getAttribute('data-job-id'),
|
||||
renderHTML: attributes => {
|
||||
if (!attributes.jobId) return {};
|
||||
return { 'data-job-id': attributes.jobId };
|
||||
},
|
||||
},
|
||||
collectionId: {
|
||||
default: 'Job_Info_Prod',
|
||||
parseHTML: element => element.getAttribute('data-collection-id') || 'Job_Info_Prod',
|
||||
renderHTML: attributes => {
|
||||
return { 'data-collection-id': attributes.collectionId || 'Job_Info_Prod' };
|
||||
},
|
||||
},
|
||||
filename: {
|
||||
default: null,
|
||||
parseHTML: element => element.getAttribute('data-filename'),
|
||||
renderHTML: attributes => {
|
||||
if (!attributes.filename) return {};
|
||||
return { 'data-filename': attributes.filename };
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user