mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-26 22:16:28 +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">
|
<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>
|
<i class="fas fa-ellipsis-v"></i>
|
||||||
</button>
|
</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">
|
<li class="title">
|
||||||
{{ i18n.t('protocols.steps.options_dropdown.title') }}
|
{{ i18n.t('protocols.steps.options_dropdown.title') }}
|
||||||
</li>
|
</li>
|
||||||
<li v-if="urls.reorder_elements_url" class="action" @click="openReorderModal">
|
<li v-if="urls.reorder_elements_url" class="action">
|
||||||
<i class="fas fa-arrows-alt-v"></i>
|
<a @click="openReorderModal" :class="{ 'disabled': elements.length < 2 }">
|
||||||
{{ i18n.t('protocols.steps.options_dropdown.rearrange') }}
|
<i class="fas fa-arrows-alt-v"></i>
|
||||||
|
{{ i18n.t('protocols.steps.options_dropdown.rearrange') }}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="urls.delete_url" class="action" @click="showDeleteModal">
|
<li v-if="urls.delete_url" class="action">
|
||||||
<i class="fas fa-trash"></i>
|
<a @click="showDeleteModal">
|
||||||
{{ i18n.t('protocols.steps.options_dropdown.delete') }}
|
<i class="fas fa-trash"></i>
|
||||||
|
{{ i18n.t('protocols.steps.options_dropdown.delete') }}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -114,7 +118,7 @@
|
||||||
:key="index"
|
:key="index"
|
||||||
:element.sync="elements[index]"
|
:element.sync="elements[index]"
|
||||||
:inRepository="inRepository"
|
:inRepository="inRepository"
|
||||||
:reorderElementUrl="urls.reorder_elements_url"
|
:reorderElementUrl="elements.length > 1 ? urls.reorder_elements_url : ''"
|
||||||
@component:delete="deleteElement"
|
@component:delete="deleteElement"
|
||||||
@update="updateElement"
|
@update="updateElement"
|
||||||
@reorder="openReorderModal"
|
@reorder="openReorderModal"
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleBlur() {
|
handleBlur() {
|
||||||
if (!this.isBlank) {
|
if (this.allowBlank || !this.isBlank) {
|
||||||
this.$nextTick(this.update);
|
this.$nextTick(this.update);
|
||||||
} else {
|
} else {
|
||||||
this.$emit('delete');
|
this.$emit('delete');
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue