mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Improve cancel edit button reliability, fix blink for non-smart-annotation fields [SCI-7068] (#4344)
This commit is contained in:
parent
a37c236518
commit
5df1701ae7
1 changed files with 9 additions and 11 deletions
|
@ -13,7 +13,7 @@
|
|||
@blur="handleBlur"
|
||||
@keyup.escape="cancelEdit"
|
||||
></textarea>
|
||||
<div v-else @click="enableEdit($event)" class="sci-inline-edit__view" v-html="(smartAnnotation ? sa_value : value) || placeholder" :class="{ 'blank': isBlank }"></div>
|
||||
<div v-else @click="enableEdit($event)" class="sci-inline-edit__view" v-html="(smartAnnotation ? sa_value : newValue) || placeholder" :class="{ 'blank': isBlank }"></div>
|
||||
<div v-if="editing && error" class="sci-inline-edit__error">
|
||||
{{ error }}
|
||||
</div>
|
||||
|
@ -22,7 +22,7 @@
|
|||
<div :class="{ 'btn-primary': !error, 'btn-disabled': error }" class="sci-inline-edit__control btn icon-btn" @click="update">
|
||||
<i class="fas fa-check"></i>
|
||||
</div>
|
||||
<div class="sci-inline-edit__control btn btn-light icon-btn" @click="cancelEdit">
|
||||
<div class="sci-inline-edit__control btn btn-light icon-btn" @mousedown="cancelEdit">
|
||||
<i class="fas fa-times"></i>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -182,7 +182,6 @@
|
|||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if(this.error) return;
|
||||
if(!this.$refs.input) return;
|
||||
this.newValue = this.$refs.input.value // Fix for smart annotation
|
||||
|
@ -190,7 +189,6 @@
|
|||
this.editing = false;
|
||||
this.$emit('editingDisabled');
|
||||
this.$emit('update', this.newValue);
|
||||
}, 100) // due to clicking 'x' also triggering a blur event
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue