MOBILE-3657 core: Remove unnecessary item-content directive

main
Pau Ferrer Ocaña 2021-04-23 13:26:37 +02:00
parent 4b60e3c3d4
commit a6574c5b11
12 changed files with 15 additions and 18 deletions

View File

@ -22,7 +22,7 @@
</ion-label>
<ion-input type="text" name="name" [placeholder]="'addon.calendar.eventname' | translate" formControlName="name">
</ion-input>
<core-input-errors item-content [control]="form.controls.name" [errorMessages]="errors"></core-input-errors>
<core-input-errors [control]="form.controls.name" [errorMessages]="errors"></core-input-errors>
</ion-item>
<!-- Date. -->
@ -34,7 +34,7 @@
</ion-label>
<ion-datetime formControlName="timestart" [placeholder]="'core.date' | translate" [displayFormat]="dateFormat">
</ion-datetime>
<core-input-errors item-content [control]="form.controls.timestart" [errorMessages]="errors"></core-input-errors>
<core-input-errors [control]="form.controls.timestart" [errorMessages]="errors"></core-input-errors>
</ion-item>
<!-- Type. -->
@ -135,7 +135,7 @@
<ion-label position="stacked">
<h2>{{ 'core.description' | translate }}</h2>
</ion-label>
<core-rich-text-editor item-content [control]="descriptionControl"
<core-rich-text-editor [control]="descriptionControl"
[placeholder]="'core.description' | translate" name="description" [component]="component"
[componentId]="eventId" [autoSave]="false"></core-rich-text-editor>
</ion-item>

View File

@ -240,7 +240,7 @@
<ion-input *ngIf="!grade.disabled" type="text" [(ngModel)]="grade.grade" min="0" [max]="gradeInfo!.grade"
[lang]="grade.lang">
</ion-input>
<p item-content *ngIf="grade.disabled">{{ 'addon.mod_assign.gradelocked' | translate }}</p>
<p *ngIf="grade.disabled">{{ 'addon.mod_assign.gradelocked' | translate }}</p>
</ion-item>
<!-- Grade using a scale. -->
@ -262,7 +262,7 @@
{{grade.label}}
</ion-select-option>
</ion-select>
<p item-content *ngIf="!canSaveGrades || !outcome.itemNumber">{{ outcome.selected }}</p>
<p *ngIf="!canSaveGrades || !outcome.itemNumber">{{ outcome.selected }}</p>
</ion-item>
<!-- Gradebook grade for simple grading. -->

View File

@ -25,7 +25,7 @@
<!-- Edit -->
<ion-item class="ion-text-wrap" *ngIf="edit && loaded">
<ion-label></ion-label>
<core-rich-text-editor item-content [control]="control" [placeholder]="plugin.name"
<core-rich-text-editor [control]="control" [placeholder]="plugin.name"
name="assignfeedbackcomments_editor" [component]="component" [componentId]="assign.cmid" [autoSave]="true"
contextLevel="module" [contextInstanceId]="assign.cmid" elementId="assignfeedbackcomments_editor"
[draftExtraParams]="{userid: userId, action: 'grade'}">

View File

@ -27,7 +27,7 @@
</ion-label>
<ion-checkbox slot="end" name="submissionstatement" [(ngModel)]="submissionStatementAccepted"></ion-checkbox>
<!-- ion-checkbox doesn't use an input. Create a hidden input to hold the value. -->
<input item-content type="hidden" [ngModel]="submissionStatementAccepted" name="submissionstatement">
<input type="hidden" [ngModel]="submissionStatementAccepted" name="submissionstatement">
</ion-item>
<addon-mod-assign-submission-plugin *ngFor="let plugin of userSubmission.plugins" [assign]="assign"

View File

@ -2,7 +2,7 @@
<ion-input *ngIf="searchMode" type="text" [placeholder]="field.name" [formControlName]="'f_'+field.id"></ion-input>
<span *ngIf="editMode" [core-mark-required]="field.required" class="core-mark-required"></span>
<core-rich-text-editor *ngIf="editMode" item-content [control]="form.controls['f_'+field.id]" [placeholder]="field.name"
<core-rich-text-editor *ngIf="editMode" [control]="form.controls['f_'+field.id]" [placeholder]="field.name"
[formControlName]="'f_'+field.id" [component]="component" [componentId]="componentId" [autoSave]="true"
contextLevel="module" [contextInstanceId]="componentId" [elementId]="'field_'+field.id" ngDefaultControl>
</core-rich-text-editor>

View File

@ -17,7 +17,7 @@
</ion-item>
<ion-item>
<ion-label position="stacked">{{ 'addon.mod_forum.message' | translate }}</ion-label>
<core-rich-text-editor item-content elementId="message"
<core-rich-text-editor elementId="message"
[name]="'mod_forum_reply_' + replyData.id" [control]="messageControl"
[placeholder]="'addon.mod_forum.replyplaceholder' | translate" [autoSave]="true"
[component]="component" [componentId]="componentId" [draftExtraParams]="{edit: replyData.id}"

View File

@ -108,7 +108,7 @@
</ion-item>
<ion-item>
<ion-label position="stacked">{{ 'addon.mod_forum.message' | translate }}</ion-label>
<core-rich-text-editor item-content elementId="message" contextLevel="module"
<core-rich-text-editor elementId="message" contextLevel="module"
[control]="messageControl" [placeholder]="'addon.mod_forum.replyplaceholder' | translate"
[name]="'mod_forum_reply_' + post.id" [component]="component" [componentId]="componentId" [autoSave]="true"
[contextInstanceId]="forum && forum.cmid" [draftExtraParams]="{reply: post.id}"

View File

@ -25,7 +25,7 @@
</ion-item>
<ion-item>
<ion-label position="stacked">{{ 'addon.mod_forum.message' | translate }}</ion-label>
<core-rich-text-editor item-content name="addon_mod_forum_new_discussion" contextLevel="module" elementId="message"
<core-rich-text-editor name="addon_mod_forum_new_discussion" contextLevel="module" elementId="message"
[control]="messageControl" [placeholder]="'addon.mod_forum.message' | translate" [component]="component"
[componentId]="forum.cmid" [autoSave]="true" [contextInstanceId]="forum.cmid"
(contentChanged)="onMessageChange($event)">

View File

@ -14,7 +14,7 @@
<span [core-mark-required]="required">{{ field.name }}</span>
<core-input-errors [control]="control"></core-input-errors>
</ion-label>
<core-rich-text-editor item-content [control]="control" [placeholder]="field.name" [autoSave]="true"
<core-rich-text-editor [control]="control" [placeholder]="field.name" [autoSave]="true"
[contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" [elementId]="modelName">
</core-rich-text-editor>
</ion-item>

View File

@ -27,15 +27,12 @@ import { Translate } from '@singletons';
*
* Please notice that the inputs need to have a FormControl to make it work. That FormControl needs to be passed to this component.
*
* If this component is placed in the same ion-item as a ion-label or ion-input, then it should have the attribute "item-content",
* otherwise Ionic will remove it.
*
* Example usage:
*
* <ion-item class="ion-text-wrap">
* <ion-label stacked core-mark-required="true">{{ 'core.login.username' | translate }}</ion-label>
* <ion-input type="text" name="username" formControlName="username"></ion-input>
* <core-input-errors item-content [control]="myForm.controls.username" [errorMessages]="usernameErrors"></core-input-errors>
* <core-input-errors [control]="myForm.controls.username" [errorMessages]="usernameErrors"></core-input-errors>
* </ion-item>
*/
@Component({

View File

@ -44,7 +44,7 @@ import { CoreEditorOffline } from '../../services/editor-offline';
* If enabled, this component will show a rich text editor. Otherwise it'll show a regular textarea.
*
* Example:
* <core-rich-text-editor item-content [control]="control" [placeholder]="field.name"></core-rich-text-editor>
* <core-rich-text-editor [control]="control" [placeholder]="field.name"></core-rich-text-editor>
*/
@Component({
selector: 'core-rich-text-editor',

View File

@ -21,7 +21,7 @@
<ion-label>
<h2>{{ 'core.settings.fontsize' | translate }}</h2>
</ion-label>
<ion-segment [(ngModel)]="selectedZoomLevel" (ionChange)="zoomLevelChanged()" color="primary" item-content>
<ion-segment [(ngModel)]="selectedZoomLevel" (ionChange)="zoomLevelChanged()" color="primary">
<ion-segment-button *ngFor="let zoomLevel of zoomLevels" [value]="zoomLevel.value"
[ngStyle]="{'font-size.px': zoomLevel.style}">
<ion-label>