
* origin/develop: Translated using Weblate (Chinese (Simplified)) Generalize IntegerSetting into NumberSetting, add Integer/Float wrappers Allow custom emoji reactions: add option to scale reaction buttons Fix user-profile route crash on pinned favorites route Hide custom emoji in reaction picker when BE does not advertise pleroma_custom_emoji_reactions Allow custom emoji reactions
24 lines
489 B
JavaScript
24 lines
489 B
JavaScript
import Setting from './setting.js'
|
|
|
|
export default {
|
|
...Setting,
|
|
props: {
|
|
...Setting.props,
|
|
truncate: {
|
|
type: Number,
|
|
required: false,
|
|
default: 1
|
|
}
|
|
},
|
|
methods: {
|
|
...Setting.methods,
|
|
getValue (e) {
|
|
if (!this.truncate === 1) {
|
|
return parseInt(e.target.value)
|
|
} else if (this.truncate > 1) {
|
|
return Math.trunc(e.target.value / this.truncate) * this.truncate
|
|
}
|
|
return parseFloat(e.target.value)
|
|
}
|
|
}
|
|
}
|