Do you think it would be good if someone (maybe me) put together a PR with 
these changes? Or is there some reason <$edit-text> shouldn't get these 
values?

Thanks!
Mark

On Sunday, June 18, 2017 at 8:53:45 AM UTC-7, Eric Shulman wrote:
>
> On Sunday, June 18, 2017 at 8:30:06 AM UTC-7, Mark S. wrote:
>>
>> The specs for the range type of input element allow min and max values. 
>> It appears that the <$edit-text> widget doesn't pass those along. Maybe a 
>> future version could?
>>
>
> There are THREE params available for type="range":
>  * min (the smallest value, default = 0)
>  * max (the largest value, default = 100)
>  * step (the increment, default = 1)
>
> To support use of these params in the <$edit-text> widget, all that is 
> needed is to pass their values along to the underlying HTML input element.
>
> To do this, just two small *additions* to the core are needed:
>
> in $:/core/modules/editor/factory.js,
> at the end of EditTextWidget.prototype.execute()
>
> add:
> this.editRangeMin  = this.getAttribute("min");
> this.editRangeMax  = this.getAttribute("max");
> this.editRangeStep = this.getAttribute("step");
>
> and in $:/core/modules/editor/engines/simple.js,
> in the SimpleEngine(options) function
> following the existing code pattern after "// Set the attributes"
>
> add:
> if(this.widget.editRangeMin) {
>    this.domNode.setAttribute("min",this.widget.editRangeMin);
> }
> if(this.widget.editRangeMax) {
>    this.domNode.setAttribute("max",this.widget.editRangeMax);
> }
> if(this.widget.editRangeStep) {
>    this.domNode.setAttribute("step",this.widget.editRangeStep);
> }
>
> enjoy,
> -e
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/170d9655-e904-4abe-911e-c45ee91b1311%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to