MOBILE-2693 data: Fix options of checkbox/multimenu fields
parent
f233dbf5b4
commit
9d6c8312e8
|
@ -40,7 +40,7 @@ export class AddonModDataFieldCheckboxComponent extends AddonModDataFieldPluginC
|
|||
return;
|
||||
}
|
||||
|
||||
this.options = this.field.param1.split('\n').map((option) => {
|
||||
this.options = this.field.param1.split(/\r?\n/).map((option) => {
|
||||
return { key: option, value: option };
|
||||
});
|
||||
|
||||
|
@ -67,7 +67,7 @@ export class AddonModDataFieldCheckboxComponent extends AddonModDataFieldPluginC
|
|||
* @param {any} value New value to be set.
|
||||
*/
|
||||
protected updateValue(value: any): void {
|
||||
this.value = value;
|
||||
this.value = value || {};
|
||||
this.value.content = value && value.content && value.content.split('##').join('<br>');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ export class AddonModDataFieldMultimenuComponent extends AddonModDataFieldPlugin
|
|||
return;
|
||||
}
|
||||
|
||||
this.options = this.field.param1.split('\n').map((option) => {
|
||||
this.options = this.field.param1.split(/\r?\n/).map((option) => {
|
||||
return { key: option, value: option };
|
||||
});
|
||||
|
||||
|
@ -67,7 +67,7 @@ export class AddonModDataFieldMultimenuComponent extends AddonModDataFieldPlugin
|
|||
* @param {any} value New value to be set.
|
||||
*/
|
||||
protected updateValue(value: any): void {
|
||||
this.value = value;
|
||||
this.value = value || {};
|
||||
this.value.content = value && value.content && value.content.split('##').join('<br>');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue