Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Irina Oleynik
synergy-components
Commits
b416bc8f
Commit
b416bc8f
authored
Dec 12, 2019
by
Ilya Veselov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
a1856483
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
emc/opening_file_when_open_document
emc/opening_file_when_open_document
+32
-0
No files found.
emc/opening_file_when_open_document
0 → 100644
View file @
b416bc8f
AS.FORMS.bus.on(AS.FORMS.EVENT_TYPE.formShow, (event, model, view) => {
const openAttachments = async documentID => {
let attachments = await AS.FORMS.ApiUtils.simpleAsyncGet(`rest/api/docflow/doc/attachments?documentID=${documentID}`);
if(attachments.work_files.length){
$(`table[document_id="${documentID}"]`)
.closest('.window-body')
.find('img[src*="images/close.png"]')
.closest('table')
.get(0)
.click();
window.location.href = '#' + jQuery.param({
submodule: 'common',
action: 'open_document',
document_identifier: documentID,
file_identifier: attachments.work_files[0].uuid
});
}
}
let documentID = AS.getUrlParam('document_identifier');
if(!documentID){
model.on(AS.FORMS.EVENT_TYPE.dataLoad, async () => {
const documentID = await AS.FORMS.ApiUtils.getDocumentIdentifier(model.asfDataId);
openAttachments(documentID);
});
}else{
openAttachments(documentID);
}
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment