mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Changed combo-box to number inputs for min, max and step values.
This commit is contained in:
parent
911d6abfad
commit
c423544208
3 changed files with 28 additions and 15 deletions
|
@ -120,9 +120,20 @@ export default Ember.Controller.extend({
|
|||
return output;
|
||||
},
|
||||
|
||||
@computed("pollOptionsCount", "isNumber")
|
||||
disableInsert(count, isNumber) {
|
||||
return isNumber ? false : (count < 2);
|
||||
@computed("pollOptionsCount", "isNumber", "pollMin", "pollMax")
|
||||
disableInsert(count, isNumber, pollMin, pollMax) {
|
||||
return (pollMin >= pollMax) || (isNumber ? false : (count < 2));
|
||||
},
|
||||
|
||||
@computed("pollMin", "pollMax")
|
||||
minMaxValueValidation(pollMin, pollMax) {
|
||||
let options = { ok: true };
|
||||
|
||||
if (pollMin >= pollMax) {
|
||||
options = { failed: true, reason: I18n.t("poll.ui_builder.help.invalid_values") };
|
||||
}
|
||||
|
||||
return InputValidation.create(options);
|
||||
},
|
||||
|
||||
@computed("disableInsert")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue