Merge pull request #2914 from NoelDeMartin/MOBILE-3833

MOBILE-3833: Chores
main
Dani Palou 2021-08-05 14:45:42 +02:00 committed by GitHub
commit 852add9da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 5 additions and 72 deletions

View File

@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/moodlehq/moodlemobile2.git"
"url": "https://github.com/moodlehq/moodleapp.git"
},
"license": "Apache-2.0",
"licenses": [

View File

@ -363,10 +363,6 @@ export class AddonCalendarListPage implements OnInit, OnDestroy {
this.daysLoaded += AddonCalendarProvider.DAYS_INTERVAL;
}
// Resize the content so infinite loading is able to calculate if it should load more items or not.
// @todo: Infinite loading is not working if content is not high enough.
// this.content.resize();
} catch (error) {
CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true);
this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.

View File

@ -71,7 +71,6 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
protected keepMessageMap: {[hash: string]: boolean} = {};
protected syncObserver: CoreEventObserver;
protected oldContentHeight = 0;
protected keyboardObserver: CoreEventObserver;
protected scrollBottom = true;
protected viewDestroyed = false;
protected memberInfoObserver: CoreEventObserver;
@ -148,12 +147,6 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
},
this.siteId,
);
// Recalculate footer position when keyboard is shown or hidden.
this.keyboardObserver = CoreEvents.on(CoreEvents.KEYBOARD_CHANGE, () => {
// @todo probably not needed.
// this.content.resize();
});
}
/**
@ -1701,7 +1694,6 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
// Unset again, just in case.
this.unsetPolling();
this.syncObserver?.off();
this.keyboardObserver?.off();
this.memberInfoObserver?.off();
this.viewDestroyed = true;
}

View File

@ -116,7 +116,7 @@
</p>
<core-send-message-form [sendDisabled]="sending" *ngIf="isOnline && polling && loaded" [message]="newMessage"
(onSubmit)="sendMessage($event)" [placeholder]="'addon.messages.newmessage' | translate" (onResize)="resizeContent()">
(onSubmit)="sendMessage($event)" [placeholder]="'addon.messages.newmessage' | translate">
</core-send-message-form>
<ion-button *ngIf="isOnline && !polling && loaded" (click)="reconnect()" expand="block" color="light">

View File

@ -23,7 +23,7 @@ import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreUtils } from '@services/utils/utils';
import { Network, NgZone, Translate } from '@singletons';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreEvents } from '@singletons/events';
import { Subscription } from 'rxjs';
import { AddonModChatUsersModalComponent, AddonModChatUsersModalResult } from '../../components/users-modal/users-modal';
import { AddonModChat, AddonModChatProvider, AddonModChatUser } from '../../services/chat';
@ -59,7 +59,6 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave {
protected lastTime = 0;
protected oldContentHeight = 0;
protected onlineSubscription: Subscription;
protected keyboardObserver: CoreEventObserver;
protected viewDestroyed = false;
protected pollingRunning = false;
protected users: AddonModChatUser[] = [];
@ -73,12 +72,6 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave {
this.isOnline = CoreApp.isOnline();
});
});
// Recalculate footer position when keyboard is shown or hidden.
this.keyboardObserver = CoreEvents.on(CoreEvents.KEYBOARD_CHANGE, () => {
// @todo probably not needed.
// this.content.resize();
});
}
/**
@ -357,30 +350,6 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave {
});
}
/**
* Content or scroll has been resized. For content, only call it if it's been added on top.
*/
resizeContent(): void {
// @todo probably not needed.
// let top = this.content.getContentDimensions().scrollTop;
// this.content.resize();
// // Wait for new content height to be calculated.
// setTimeout(() => {
// // Visible content size changed, maintain the bottom position.
// if (!this.viewDestroyed && this.content && this.domUtils.getContentHeight(this.content) != this.oldContentHeight) {
// if (!top) {
// top = this.content.getContentDimensions().scrollTop;
// }
// top += this.oldContentHeight - this.domUtils.getContentHeight(this.content);
// this.oldContentHeight = this.domUtils.getContentHeight(this.content);
// this.content.scrollTo(0, top, 0);
// }
// });
}
/**
* Check if we can leave the page or not.
*
@ -402,7 +371,6 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave {
*/
ngOnDestroy(): void {
this.onlineSubscription && this.onlineSubscription.unsubscribe();
this.keyboardObserver && this.keyboardObserver.off();
this.stopPolling();
this.viewDestroyed = true;
}

View File

@ -109,8 +109,6 @@ export abstract class CorePageItemsListManager<Item> {
this.selectedItem = null;
}
// @todo Implement watchResize.
/**
* Check whether the given item is selected or not.
*

View File

@ -76,19 +76,6 @@ export class CoreTabsComponent extends CoreTabsBaseComponent<CoreTabComponent> i
*/
protected async initializeTabs(): Promise<void> {
await super.initializeTabs();
// @todo: Is this still needed?
// if (this.content) {
// if (!this.parentScrollable) {
// // Parent scroll element (if core-tabs is inside a ion-content).
// const scroll = await this.content.getScrollElement();
// if (scroll) {
// scroll.classList.add('no-scroll');
// }
// } else {
// this.originalTabsContainer?.classList.add('no-scroll');
// }
// }
}
/**

View File

@ -23,8 +23,6 @@ import { CoreNavigator } from '@services/navigator';
/**
* Page to display the list of sites to choose one to perform a content link action.
*
* @todo Include routing and testing.
*/
@Component({
selector: 'core-content-links-choose-site-modal',

View File

@ -241,8 +241,6 @@ export class CoreMainMenuProvider {
if (tablet != this.tablet) {
this.tablet = tablet;
// @todo Resize so content margins can be updated.
}
return tablet ? 'side' : 'bottom';

View File

@ -405,7 +405,7 @@ export class CoreSettingsHelperProvider {
*/
applyZoomLevel(zoomLevel: CoreZoomLevel): void {
const zoom = CoreConstants.CONFIG.zoomlevels[zoomLevel];
// @todo Since zoom is deprecated and fontSize is not working, we should do some research here.
// @todo MOBILE-3790 non-standard property, doesn't work everywhere.
document.documentElement.style.zoom = zoom + '%';
}

View File

@ -23,8 +23,6 @@ import { CoreNavigator } from '@services/navigator';
/**
* Page that displays the tag index area.
*
* @todo testing.
*/
@Component({
selector: 'page-core-tag-index-area',

View File

@ -104,8 +104,6 @@ export class CoreFileProvider {
constructor() {
this.logger = CoreLogger.getInstance('CoreFileProvider');
// @todo: Check if redefining FileReader getters and setters is still needed in Android.
}
/**

View File

@ -1986,7 +1986,7 @@ function fixIOSPopoverPosition(baseEl: HTMLElement, ev?: Event): void {
* which doesn't return the correct dimensions when the `zoom` CSS property is being used. This is only a temporary solution
* in Android because system zooming is already supported, so it won't be necessary to do it at an app level.
*
* @todo remove the ability to zoom in Android.
* @todo MOBILE-3790 remove the ability to zoom in Android.
*
* This function has been copied in its entirety from Ionic's source code, only changing the aforementioned calculation
* of the body dimensions with `document.body.clientXXX`.