mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-03 02:14:29 +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 protocolsContainer = '.protocols-container';
|
||||||
let versionsModal = '#protocol-versions-modal';
|
let versionsModal = '#protocol-versions-modal';
|
||||||
|
|
||||||
protocolsTableEl.on('click', '.protocol-versions-link', function(e) {
|
function loadVersionModal(href) {
|
||||||
$.get(this.href, function(data) {
|
$.get(href, function(data) {
|
||||||
$(protocolsContainer).append($.parseHTML(data.html));
|
$(protocolsContainer).append($.parseHTML(data.html));
|
||||||
$(versionsModal).modal('show');
|
$(versionsModal).modal('show');
|
||||||
inlineEditing.init();
|
inlineEditing.init();
|
||||||
|
@ -415,12 +415,16 @@ var ProtocolsIndex = (function() {
|
||||||
$(versionsModal).remove();
|
$(versionsModal).remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protocolsTableEl.on('click', '.protocol-versions-link', function(e) {
|
||||||
|
loadVersionModal(this.href);
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(protocolsContainer).on('click', '#protocolVersions', function() {
|
$(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_RowId: record.id,
|
||||||
DT_RowAttr: {
|
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),
|
'1': name_html(parent),
|
||||||
'2': parent.code,
|
'2': parent.code,
|
||||||
|
|
Loading…
Add table
Reference in a new issue