mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
fixing the fix
there is probably a nicer solution to let the calling widget know that getValues() is running triggering a custom event won't help, as getValues() is not async and can't be made to wait for the widget handling the event
This commit is contained in:
parent
caf3734faf
commit
7ad9e2cd4f
@ -547,7 +547,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
|
|||||||
{
|
{
|
||||||
// are we called by etemplate2.getValues() (has a closure result)
|
// 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
|
// not always setting it, as getValue() is called a lot, e.g. to test input is dirty
|
||||||
if (this.options.applyDefaultFont && typeof result !== 'undefined')
|
if (this.options.applyDefaultFont && this.getInstanceManager().get_values)
|
||||||
{
|
{
|
||||||
this.applyDefaultFont();
|
this.applyDefaultFont();
|
||||||
}
|
}
|
||||||
|
@ -1216,15 +1216,23 @@ export class etemplate2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag that getValues() is running
|
||||||
|
*/
|
||||||
|
get_values = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches all input element values and returns them in an associative
|
* Fetches all input element values and returns them in an associative
|
||||||
* array. Widgets which introduce namespacing can use the internal _target
|
* array. Widgets which introduce namespacing can use the internal _target
|
||||||
* parameter to add another layer.
|
* parameter to add another layer.
|
||||||
*
|
*
|
||||||
* @param {et2_widget} _root widget to start iterating
|
* @param {et2_widget} _root widget to start iterating
|
||||||
|
* @param {boolean} skip_reset_dirty true: do NOT reset dirty status
|
||||||
*/
|
*/
|
||||||
getValues(_root : et2_widget)
|
getValues(_root : et2_widget, skip_reset_dirty : boolean)
|
||||||
{
|
{
|
||||||
|
this.get_values = true;
|
||||||
|
|
||||||
const result = {};
|
const result = {};
|
||||||
|
|
||||||
// Iterate over the widget tree
|
// Iterate over the widget tree
|
||||||
@ -1320,10 +1328,15 @@ export class etemplate2
|
|||||||
}
|
}
|
||||||
delete _target[path[path.length - 1]];
|
delete _target[path[path.length - 1]];
|
||||||
}
|
}
|
||||||
_widget.resetDirty();
|
if (!skip_reset_dirty)
|
||||||
|
{
|
||||||
|
_widget.resetDirty();
|
||||||
|
}
|
||||||
|
|
||||||
}, this, et2_IInput);
|
}, this, et2_IInput);
|
||||||
|
|
||||||
|
this.get_values = false;
|
||||||
|
|
||||||
egw().debug("info", "Value", result);
|
egw().debug("info", "Value", result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -4059,17 +4059,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
action = _egw_action.id;
|
action = _egw_action.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
var widgets = ['from','to','cc','bcc','subject','folder','replyto','mailaccount',
|
Object.assign(content, self.et2.getInstanceManager().getValues(self.et2, true));
|
||||||
'mail_htmltext', 'mail_plaintext', 'lastDrafted', 'filemode', 'expiration', 'password'];
|
|
||||||
var widget = {};
|
|
||||||
for (var index in widgets)
|
|
||||||
{
|
|
||||||
widget = self.et2.getWidgetById(widgets[index]);
|
|
||||||
if (widget)
|
|
||||||
{
|
|
||||||
content[widgets[index]] = widget.get_value();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (content)
|
if (content)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user