adding optional submit_value parameter to widget getValue() method to let widgets know value is needed for submit/getValues

This commit is contained in:
ralf
2024-02-06 09:21:05 +02:00
parent 372e6ebbdb
commit be7f95d0aa
4 changed files with 27 additions and 20 deletions

View File

@ -541,13 +541,15 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
this.value = _value;
}
getValue()
/**
* @param boolean submit_value true: call by etemplate2.(getValues|submit|postSubmit)()
*/
getValue(submit_value? : boolean)
{
if (this.editor)
{
// are we called by etemplate2.getValues() (has a closure result)
// not always setting it, as getValue() is called a lot, e.g. to test input is dirty
if (this.options.applyDefaultFont && this.getInstanceManager().get_values)
// not always applying defaut font, as getValue() is called a lot, e.g. to test input is dirty
if (this.options.applyDefaultFont && submit_value)
{
this.applyDefaultFont();
}