mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 03:35:25 +08:00
Merge pull request #5846 from sboursen-scinote/sb_SCI-8239
Save as new protocol template from task - read the protocol name [SCI-8239]
This commit is contained in:
commit
f44f083b0b
2 changed files with 5 additions and 0 deletions
|
@ -26,6 +26,10 @@
|
||||||
.on('shown.bs.modal', function() {
|
.on('shown.bs.modal', function() {
|
||||||
$(`${protocolModal} #protocol_name`).parent().removeClass('error');
|
$(`${protocolModal} #protocol_name`).parent().removeClass('error');
|
||||||
$(`${protocolModal} #protocol_name`).val('');
|
$(`${protocolModal} #protocol_name`).val('');
|
||||||
|
const protocolName = $(`a[data-target="${protocolModal}"]`).attr('data-protocol-name');
|
||||||
|
if (protocolName) {
|
||||||
|
$(this).find('.sci-input-field').val(protocolName);
|
||||||
|
}
|
||||||
$(this).find('.sci-input-field').focus();
|
$(this).find('.sci-input-field').focus();
|
||||||
})
|
})
|
||||||
.on('ajax:error', 'form', function(e, error) {
|
.on('ajax:error', 'form', function(e, error) {
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
<a
|
<a
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
data-target="#newProtocolModal"
|
data-target="#newProtocolModal"
|
||||||
|
v-bind:data-protocol-name="protocol.attributes.name"
|
||||||
:class="{ disabled: !protocol.attributes.urls.save_to_repo_url }"
|
:class="{ disabled: !protocol.attributes.urls.save_to_repo_url }"
|
||||||
>
|
>
|
||||||
<span class="fas fa-save"></span>
|
<span class="fas fa-save"></span>
|
||||||
|
|
Loading…
Reference in a new issue