Merge pull request #3178 from crazyserver/MOBILE-3814

Mobile 3814
main
Dani Palou 2022-03-15 14:07:24 +01:00 committed by GitHub
commit 1b6e578c41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 12 deletions

View File

@ -1,9 +1,7 @@
:host .core-block-content ::ng-deep {
ul.inline-list {
font-size: 80%;
list-style: none;
margin-left: 0;
margin-right: 0;
margin: 0;
-webkit-padding-start: 0;
li {

View File

@ -1,11 +1,9 @@
:host .core-block-content ::ng-deep {
.tag_cloud {
font-size: 80%;
text-align: center;
ul.inline-list {
list-style: none;
margin-left: 0;
margin-right: 0;
margin: 0;
-webkit-padding-start: 0;
li {

View File

@ -34,7 +34,7 @@
<ion-list *ngIf="!isSearch && entries && entries.offlineEntries.length > 0">
<ion-item-divider>
<ion-label>
<h2>{{ 'addon.mod_glossary.entriestobesynced' | translate }}</h2>
<h2 class="big">{{ 'addon.mod_glossary.entriestobesynced' | translate }}</h2>
</ion-label>
</ion-item-divider>
<ion-item *ngFor="let entry of entries.offlineEntries" (click)="entries.select(entry)" detail="false" button
@ -51,7 +51,7 @@
<ng-container *ngFor="let entry of entries.onlineEntries; let index = index">
<ion-item-divider *ngIf="getDivider && showDivider(entry, entries.onlineEntries[index - 1])">
<ion-label>
<h2>{{ getDivider!(entry) }}</h2>
<h2 class="big">{{ getDivider!(entry) }}</h2>
</ion-label>
</ion-item-divider>

View File

@ -24,7 +24,7 @@
<core-infinite-loading [enabled]="canLoadMore" (action)="showMoreActivities($event)"></core-infinite-loading>
</div>
<div collapsible-footer appearOnBottom *ngIf="displayCourseIndex && (previousSection || nextSection)" slot="fixed">
<div collapsible-footer appearOnBottom *ngIf="displayCourseIndex && hasPreviousOrNextSections" slot="fixed">
<div class="core-course-section-nav-buttons safe-area-padding-horizontal list-item-limited-width">
<ion-button *ngIf="previousSection" (click)="sectionChanged(previousSection)" expand="block"
[attr.aria-label]="('core.previous' | translate) + ': ' + previousSection.name">

View File

@ -92,6 +92,7 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
selectedSection?: CoreCourseSection;
previousSection?: CoreCourseSection;
nextSection?: CoreCourseSection;
hasPreviousOrNextSections = false;
allSectionsId: number = CoreCourseProvider.ALL_SECTIONS_ID;
stealthModulesSectionId: number = CoreCourseProvider.STEALTH_MODULES_SECTION_ID;
loaded = false;
@ -488,6 +489,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
this.showMoreActivities();
}
this.hasPreviousOrNextSections = !!this.previousSection || !!this.nextSection;
// Scroll to module if needed. Give more priority to the input.
const moduleIdToScroll = this.moduleId && previousValue === undefined ? this.moduleId : moduleId;
if (moduleIdToScroll) {

View File

@ -40,6 +40,7 @@ import { CoreEventFormActionData, CoreEventObserver, CoreEvents, CoreSingleTimeE
import { CoreEditorOffline } from '../../services/editor-offline';
import { CoreComponentsRegistry } from '@singletons/components-registry';
import { CoreLoadingComponent } from '@components/loading/loading';
import { CoreScreen } from '@services/screen';
/**
* Component to display a rich text editor if enabled.
@ -150,7 +151,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentIn
*/
ngOnInit(): void {
this.canScanQR = CoreUtils.canScanQR();
this.isPhone = Platform.is('mobile') && !Platform.is('tablet');
this.isPhone = CoreScreen.isMobile;
this.toolbarHidden = this.isPhone;
this.direction = Platform.isRTL ? 'rtl' : 'ltr';
}
@ -161,6 +162,8 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentIn
async ngAfterContentInit(): Promise<void> {
this.rteEnabled = await CoreDomUtils.isRichTextEditorEnabled();
await this.waitLoadingsDone();
// Setup the editor.
this.editorElement = this.editor?.nativeElement as HTMLDivElement;
this.setContent(this.control?.value);
@ -175,8 +178,6 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentIn
// Use paragraph on enter.
document.execCommand('DefaultParagraphSeparator', false, 'p');
await this.waitLoadingsDone();
this.maximizeEditorSize();
this.setListeners();
@ -1052,6 +1053,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentIn
*/
protected async windowResized(): Promise<void> {
await CoreDomUtils.waitForResizeDone();
this.isPhone = CoreScreen.isMobile;
this.maximizeEditorSize();
this.updateToolbarButtons();