mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Fix selected default step title and step name placeholder [SCI-7067] (#4326)
* Fix selected default step title in edit mode and step name placeholder [SCI-7067] * Add new placeholder label [SCI-7067]
This commit is contained in:
parent
6bfb25ba50
commit
1ee091aa53
3 changed files with 8 additions and 1 deletions
|
@ -44,6 +44,8 @@
|
||||||
:allowBlank="false"
|
:allowBlank="false"
|
||||||
:attributeName="`${i18n.t('Step')} ${i18n.t('name')}`"
|
:attributeName="`${i18n.t('Step')} ${i18n.t('name')}`"
|
||||||
:autofocus="editingName"
|
:autofocus="editingName"
|
||||||
|
:placeholder="i18n.t('protocols.steps.placeholder')"
|
||||||
|
:defaultValue="i18n.t('protocols.steps.default_name')"
|
||||||
@editingEnabled="editingName = true"
|
@editingEnabled="editingName = true"
|
||||||
@editingDisabled="editingName = false"
|
@editingDisabled="editingName = false"
|
||||||
:editOnload="step.newStep == true"
|
:editOnload="step.newStep == true"
|
||||||
|
|
|
@ -46,7 +46,8 @@
|
||||||
allowNewLine: { type: Boolean, default: false },
|
allowNewLine: { type: Boolean, default: false },
|
||||||
multilinePaste: { type: Boolean, default: false },
|
multilinePaste: { type: Boolean, default: false },
|
||||||
smartAnnotation: { type: Boolean, default: false },
|
smartAnnotation: { type: Boolean, default: false },
|
||||||
editOnload: { type: Boolean, default: false }
|
editOnload: { type: Boolean, default: false },
|
||||||
|
defaultValue: { type: String, default: '' }
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -126,6 +127,9 @@
|
||||||
this.editing = true;
|
this.editing = true;
|
||||||
this.focus();
|
this.focus();
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.input.value === this.defaultValue) {
|
||||||
|
this.$refs.input.select();
|
||||||
|
}
|
||||||
if (this.smartAnnotation) {
|
if (this.smartAnnotation) {
|
||||||
SmartAnnotation.init($(this.$refs.input));
|
SmartAnnotation.init($(this.$refs.input));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2525,6 +2525,7 @@ en:
|
||||||
success_flash: 'Protocol <strong>%{name}</strong> successfully imported to %{type}.'
|
success_flash: 'Protocol <strong>%{name}</strong> successfully imported to %{type}.'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
placeholder: 'Enter step name'
|
||||||
default_name: 'Untitled step'
|
default_name: 'Untitled step'
|
||||||
completed: 'Completed'
|
completed: 'Completed'
|
||||||
uncompleted: 'Uncompleted'
|
uncompleted: 'Uncompleted'
|
||||||
|
|
Loading…
Reference in a new issue