mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 06:33:43 +08:00
36a9b5d0fa
Instead of ```hbs {{on "input" (action this.foo value="target.value")}} {{on "input" (action (mut this.bar) value="target.value")}} ``` you can use: ```hbs {{on "input" (with-event-value this.foo)}} {{on "input" (with-event-value (fn (mut this.bar)))}} ``` or in gjs: ```gjs import { fn } from "@ember/helper"; import { on } from "@ember/modifier"; import withEventValue from "discourse/helpers/with-event-value"; … {{on "input" (withEventValue (fn (mut this.bar)))}} ```
11 lines
371 B
Handlebars
11 lines
371 B
Handlebars
<input
|
|
{{on "input" (with-event-value (fn (mut this.value)))}}
|
|
type="number"
|
|
value={{this.value}}
|
|
min={{if this.setting.min this.setting.min null}}
|
|
max={{if this.setting.max this.setting.max null}}
|
|
class="input-setting-integer"
|
|
/>
|
|
|
|
<SettingValidationMessage @message={{this.validationMessage}} />
|
|
<div class="desc">{{html-safe this.setting.description}}</div> |