mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 08:23:12 +01:00
fix one left over needed property and added getter&setter for deprecated needed property
This commit is contained in:
parent
1518c38c72
commit
cdb944147f
@ -82,6 +82,26 @@ const Et2InputWidgetMixin = (superclass) =>
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compatibility for deprecated name "needed"
|
||||||
|
*
|
||||||
|
* @deprecated use required instead
|
||||||
|
* @param val
|
||||||
|
*/
|
||||||
|
set needed(val : boolean)
|
||||||
|
{
|
||||||
|
this.required = val;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Compatibility for deprecated name "needed"
|
||||||
|
*
|
||||||
|
* @deprecated use required instead
|
||||||
|
*/
|
||||||
|
get needed()
|
||||||
|
{
|
||||||
|
return this.required;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(...args : any[])
|
constructor(...args : any[])
|
||||||
{
|
{
|
||||||
super(...args);
|
super(...args);
|
||||||
@ -103,7 +123,7 @@ const Et2InputWidgetMixin = (superclass) =>
|
|||||||
{
|
{
|
||||||
super.updated(changedProperties);
|
super.updated(changedProperties);
|
||||||
|
|
||||||
// Needed changed, add / remove validator
|
// required changed, add / remove validator
|
||||||
if(changedProperties.has('required'))
|
if(changedProperties.has('required'))
|
||||||
{
|
{
|
||||||
// Remove class
|
// Remove class
|
||||||
@ -216,7 +236,7 @@ const Et2InputWidgetMixin = (superclass) =>
|
|||||||
debugger;
|
debugger;
|
||||||
|
|
||||||
// Check for required
|
// Check for required
|
||||||
if(this.needed && !this.readonly && !this.disabled &&
|
if(this.required && !this.readonly && !this.disabled &&
|
||||||
(this.getValue() == null || this.getValue().valueOf() == ''))
|
(this.getValue() == null || this.getValue().valueOf() == ''))
|
||||||
{
|
{
|
||||||
messages.push(this.egw().lang('Field must not be empty !!!'));
|
messages.push(this.egw().lang('Field must not be empty !!!'));
|
||||||
|
Loading…
Reference in New Issue
Block a user