mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-28 07:54:28 +08:00
Fix version button at action toolbar [SCI-8065] (#5085)
This commit is contained in:
parent
0ab89db29c
commit
1d9785efbe
2 changed files with 9 additions and 4 deletions
|
@ -403,8 +403,8 @@ var ProtocolsIndex = (function() {
|
|||
let protocolsContainer = '.protocols-container';
|
||||
let versionsModal = '#protocol-versions-modal';
|
||||
|
||||
protocolsTableEl.on('click', '.protocol-versions-link', function(e) {
|
||||
$.get(this.href, function(data) {
|
||||
function loadVersionModal(href) {
|
||||
$.get(href, function(data) {
|
||||
$(protocolsContainer).append($.parseHTML(data.html));
|
||||
$(versionsModal).modal('show');
|
||||
inlineEditing.init();
|
||||
|
@ -415,12 +415,16 @@ var ProtocolsIndex = (function() {
|
|||
$(versionsModal).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protocolsTableEl.on('click', '.protocol-versions-link', function(e) {
|
||||
loadVersionModal(this.href);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(protocolsContainer).on('click', '#protocolVersions', function() {
|
||||
$(`tr[data-row-id=${rowsSelected[0]}] .protocol-versions-link`).click();
|
||||
loadVersionModal($(`tr[data-row-id=${rowsSelected[0]}]`).data('versions-url'));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,8 @@ class ProtocolsDatatable < CustomDatatable
|
|||
{
|
||||
DT_RowId: record.id,
|
||||
DT_RowAttr: {
|
||||
'data-permissions-url': permissions_protocol_path(parent)
|
||||
'data-permissions-url': permissions_protocol_path(parent),
|
||||
'data-versions-url': versions_modal_protocol_path(parent)
|
||||
},
|
||||
'1': name_html(parent),
|
||||
'2': parent.code,
|
||||
|
|
Loading…
Add table
Reference in a new issue