remove unsued props, try to improve error feedback #306

This commit is contained in:
Leo Germani 2019-10-03 17:01:53 -03:00
parent 2a12bd733b
commit a9d12f31f3
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,8 @@
size="is-small" size="is-small"
@input="validate_values()" @input="validate_values()"
:step="options.step" :step="options.step"
v-model="valueInit"/> v-model="valueInit"
/>
<p class="is-size-7 has-text-centered is-marginless">{{ $i18n.get('label_until') }}</p> <p class="is-size-7 has-text-centered is-marginless">{{ $i18n.get('label_until') }}</p>
<b-numberinput <b-numberinput
:aria-labelledby="labelId" :aria-labelledby="labelId"
@ -35,6 +36,7 @@
collectionId: '', collectionId: '',
metadatum: '', metadatum: '',
options: [], options: [],
withError: false
} }
}, },
props: { props: {
@ -48,16 +50,15 @@
validate_values: _.debounce( function (){ validate_values: _.debounce( function (){
if ( parseFloat( this.valueInit ) > parseFloat( this.valueEnd )) { if ( parseFloat( this.valueInit ) > parseFloat( this.valueEnd )) {
//this.valueEnd = parseFloat( this.valueInit ) + 1; //this.valueEnd = parseFloat( this.valueInit ) + 1;
//this.error_message(); //this.withError = true;
return; return;
} }
//this.withError = false;
this.emit(); this.emit();
}, 600), }, 600),
// message for error // message for error
error_message(){ error_message(){
if ( !this.isTouched ) return false;
this.$buefy.toast.open({ this.$buefy.toast.open({
duration: 3000, duration: 3000,
message: this.$i18n.get('info_error_first_value_greater'), message: this.$i18n.get('info_error_first_value_greater'),

View File

@ -15,8 +15,7 @@ class Numeric_Interval extends Filter_Type {
$this->set_form_component('tainacan-filter-form-numeric-interval'); $this->set_form_component('tainacan-filter-form-numeric-interval');
$this->set_use_max_options(false); $this->set_use_max_options(false);
$this->set_default_options([ $this->set_default_options([
'step' => 1, 'step' => 1
'input-mode' => 'custom'
]); ]);
$this->set_preview_template(' $this->set_preview_template('
<div> <div>