mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Fix protocol title, disable reordering of elements if less than 2 [SCI-6934] (#4187)
This commit is contained in:
parent
a0578e09bb
commit
79b801121a
2 changed files with 13 additions and 9 deletions
|
@ -89,17 +89,21 @@
|
|||
<button class="btn btn-light dropdown-toggle insert-button" type="button" :id="'stepInserMenu_' + step.id" data-toggle="dropdown" data-display="static" aria-haspopup="true" aria-expanded="true">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu insert-element-dropdown" :aria-labelledby="'stepInserMenu_' + step.id">
|
||||
<ul class="dropdown-menu dropdown-menu-right insert-element-dropdown" :aria-labelledby="'stepInserMenu_' + step.id">
|
||||
<li class="title">
|
||||
{{ i18n.t('protocols.steps.options_dropdown.title') }}
|
||||
</li>
|
||||
<li v-if="urls.reorder_elements_url" class="action" @click="openReorderModal">
|
||||
<li v-if="urls.reorder_elements_url" class="action">
|
||||
<a @click="openReorderModal" :class="{ 'disabled': elements.length < 2 }">
|
||||
<i class="fas fa-arrows-alt-v"></i>
|
||||
{{ i18n.t('protocols.steps.options_dropdown.rearrange') }}
|
||||
</a>
|
||||
</li>
|
||||
<li v-if="urls.delete_url" class="action" @click="showDeleteModal">
|
||||
<li v-if="urls.delete_url" class="action">
|
||||
<a @click="showDeleteModal">
|
||||
<i class="fas fa-trash"></i>
|
||||
{{ i18n.t('protocols.steps.options_dropdown.delete') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -114,7 +118,7 @@
|
|||
:key="index"
|
||||
:element.sync="elements[index]"
|
||||
:inRepository="inRepository"
|
||||
:reorderElementUrl="urls.reorder_elements_url"
|
||||
:reorderElementUrl="elements.length > 1 ? urls.reorder_elements_url : ''"
|
||||
@component:delete="deleteElement"
|
||||
@update="updateElement"
|
||||
@reorder="openReorderModal"
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
}
|
||||
},
|
||||
handleBlur() {
|
||||
if (!this.isBlank) {
|
||||
if (this.allowBlank || !this.isBlank) {
|
||||
this.$nextTick(this.update);
|
||||
} else {
|
||||
this.$emit('delete');
|
||||
|
|
Loading…
Reference in a new issue