Makes each metatada type decide if its input should debounce or not.
This commit is contained in:
parent
883b5a4574
commit
ffaede4317
|
@ -69,8 +69,11 @@
|
|||
else
|
||||
value = Number(value);
|
||||
|
||||
this.$emit('update:value', value);
|
||||
this.changeValue(value);
|
||||
},
|
||||
changeValue: _.debounce(function(value) {
|
||||
this.$emit('update:value', value);
|
||||
}, 800),
|
||||
onBlur() {
|
||||
this.$emit('blur');
|
||||
},
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
:is-mobile-screen="isMobileScreen"
|
||||
:is-focused="isFocused"
|
||||
:is-metadata-navigation="isMetadataNavigation"
|
||||
@update:value="changeValue"
|
||||
@update:value="performValueChange"
|
||||
@blur="performValueChange"
|
||||
@mobile-special-focus="onMobileSpecialFocus" />
|
||||
<template v-if="isMultiple && values.length > 1">
|
||||
|
@ -102,7 +102,7 @@
|
|||
:is-mobile-screen="isMobileScreen"
|
||||
:is-focused="isFocused"
|
||||
:is-metadata-navigation="isMetadataNavigation"
|
||||
@update:value="changeValue"
|
||||
@update:value="performValueChange"
|
||||
@blur="performValueChange"
|
||||
@mobile-special-focus="onMobileSpecialFocus" />
|
||||
<a
|
||||
|
@ -159,7 +159,7 @@
|
|||
:is-focused="isFocused"
|
||||
:is-metadata-navigation="isMetadataNavigation"
|
||||
:enumerate-metadatum="enumerateMetadatum"
|
||||
@update:value="changeValue"
|
||||
@update:value="performValueChange"
|
||||
@blur="performValueChange"
|
||||
@mobile-special-focus="onMobileSpecialFocus" />
|
||||
</div>
|
||||
|
@ -285,9 +285,6 @@
|
|||
this.itemMetadatum.value == null || this.itemMetadatum.value == undefined ? this.values = [] : this.values.push(this.itemMetadatum.value);
|
||||
}
|
||||
},
|
||||
changeValue: _.debounce(function() {
|
||||
this.performValueChange();
|
||||
}, 800),
|
||||
performValueChange() {
|
||||
|
||||
// Compound metadata do not emit values, only their children.
|
||||
|
@ -353,11 +350,11 @@
|
|||
},
|
||||
addValue(){
|
||||
this.values.push('');
|
||||
this.changeValue();
|
||||
this.performValueChange();
|
||||
},
|
||||
removeValue(index) {
|
||||
this.values.splice(index, 1);
|
||||
this.changeValue();
|
||||
this.performValueChange();
|
||||
},
|
||||
onMobileSpecialFocus() {
|
||||
if (this.isMobileScreen)
|
||||
|
|
|
@ -127,8 +127,11 @@
|
|||
if ( inputRef && this.getMaxlength && !inputRef.checkHtml5Validity() )
|
||||
return;
|
||||
|
||||
this.$emit('update:value', value);
|
||||
this.changeValue(value);
|
||||
},
|
||||
changeValue: _.debounce(function(value) {
|
||||
this.$emit('update:value', value);
|
||||
}, 750),
|
||||
onBlur() {
|
||||
this.isInputFocused = false;
|
||||
this.$emit('blur');
|
||||
|
|
|
@ -38,8 +38,11 @@
|
|||
if ( inputRef && this.getMaxlength && !inputRef.checkHtml5Validity() )
|
||||
return;
|
||||
|
||||
this.$emit('update:value', value);
|
||||
this.changeValue(value);
|
||||
},
|
||||
changeValue: _.debounce(function(value) {
|
||||
this.$emit('update:value', value);
|
||||
}, 750),
|
||||
onBlur() {
|
||||
this.$emit('blur');
|
||||
},
|
||||
|
|
|
@ -47,8 +47,12 @@ export default {
|
|||
onInput(value) {
|
||||
this.isPreviewingHtml = false;
|
||||
this.singleHTMLPreview = '';
|
||||
this.$emit('update:value', value);
|
||||
|
||||
this.changeValue(value);
|
||||
},
|
||||
changeValue: _.debounce(function(value) {
|
||||
this.$emit('update:value', value);
|
||||
}, 750),
|
||||
onBlur() {
|
||||
this.$emit('blur');
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue