Added height and weight filters to actors overview.

This commit is contained in:
DebaucheryLibrarian
2021-03-03 16:47:57 +01:00
parent cdb47066cc
commit 74e33303ed
4 changed files with 126 additions and 20 deletions

View File

@@ -22,7 +22,8 @@
:disabled="disabled"
type="range"
class="slider"
@change="emit"
@input="emit('input')"
@change="emit('change')"
@click.stop
>
@@ -34,7 +35,8 @@
:disabled="disabled"
type="range"
class="slider"
@change="emit"
@input="emit('input')"
@change="emit('change')"
@click.stop
>
</div>
@@ -59,20 +61,20 @@ function maxValue() {
}
function minPercentage() {
return (this.minValue / this.max) * 100;
return ((this.minValue - this.min) / (this.max - this.min)) * 100;
}
function maxPercentage() {
return (this.maxValue / this.max) * 100;
return ((this.maxValue - this.min) / (this.max - this.min)) * 100;
}
function emit() {
function emit(type = 'change') {
if (this.values) {
this.$emit('change', [this.values[this.minValue], this.values[this.maxValue]]);
this.$emit(type, [this.values[this.minValue], this.values[this.maxValue]]);
return;
}
this.$emit('change', [this.minValue, this.maxValue]);
this.$emit(type, [this.minValue, this.maxValue]);
}
function setNearest(event) {
@@ -115,7 +117,7 @@ export default {
default: false,
},
},
emits: ['change'],
emits: ['change', 'input'],
data() {
if (this.values) {
return {