Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile 3947 #3867

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 5 additions & 26 deletions src/core/classes/page-transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { createAnimation } from '@ionic/angular';
import { Animation, NavOptions } from '@ionic/core';
import { TransitionOptions, createAnimation, getIonPageElement } from '@ionic/angular';
import { Animation } from '@ionic/core';

/**
* Adaptation from Ionic 5 iOs transition.
* Adaptation from Ionic 7 iOs transition.
*
* https://github.com/ionic-team/ionic-framework/blob/5.8.x/core/src/utils/transition/ios.transition.ts
* https://github.com/ionic-team/ionic-framework/blob/v7.5.6/core/src/utils/transition/ios.transition.ts
* Removed large title options, translucent header, buttons-collapse and header-collapse-condense-inactive.
* Changed large title check by collapsible header.
*/

const DURATION = 540;

const getIonPageElement = (element: HTMLElement): HTMLElement | null => {
if (element.classList.contains('ion-page')) {
return element;
}

const ionPage: HTMLElement | null = element.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs');
if (ionPage) {
return ionPage;
}

// idk, return the original element so at least something animates and we don't have a null pointer
return element;
};

export interface TransitionOptions extends NavOptions {
progressCallback?: ((ani: Animation | undefined) => void);
baseEl: HTMLElement;
enteringEl: HTMLElement;
leavingEl: HTMLElement | undefined;
}

export const shadow = <T extends Element>(el: T): ShadowRoot | T => el.shadowRoot || el;
const shadow = <T extends Element>(el: T): ShadowRoot | T => el.shadowRoot || el;

export const moodleTransitionAnimation = (navEl: HTMLElement, opts: TransitionOptions): Animation => {
const EASING = 'cubic-bezier(0.32,0.72,0,1)';
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/loading/loading.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
@include inline();
}

:host-context(.limited-width > ):not([slot]),
:host-context(.menu > ):not([slot]) {
:host-context(.limited-width > *):not([slot]),
:host-context(.menu > *):not([slot]) {
&.core-loading-loaded {
--contents-display: flex;
flex-direction: column;
Expand Down
Loading