mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Prefill the protocol name in modal when saving from template [SCI-8239]
This commit is contained in:
parent
e7c238ab3d
commit
634d4b6066
|
@ -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