Skip to content

Commit

Permalink
fix #71 format value to properly interact with model and other fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Bijaoui committed Sep 22, 2016
1 parent 11344c4 commit b48c7f1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/fields/fieldNoUiSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@
this.value = parseFloat(value);
}
},
formatValueToField(value) {
if(this.slider !== null && typeof this.slider.noUiSlider !== "undefined"){
this.slider.noUiSlider.set(value);
}
},
formatValueToModel() {
if(typeof this.slider.noUiSlider !== "undefined"){
let val = this.slider.noUiSlider.get();
if (val instanceof Array) {
return [Number(val[0]), Number(val[1])];
}else{
return Number(val);
}
}
},
getStartValue(){
if (this.value != null) {
return this.value;
Expand Down

0 comments on commit b48c7f1

Please sign in to comment.