commit
a2ddd6724f
|
@ -1,4 +1,3 @@
|
||||||
<ion-button (click)="openBlocks()" [userTour]="userTour" [attr.aria-label]="'core.block.opendrawerblocks' | translate" color="secondary"
|
<ion-button (click)="openBlocks()" [userTour]="userTour" [attr.aria-label]="'core.block.opendrawerblocks' | translate" color="secondary">
|
||||||
#button>
|
|
||||||
<ion-icon name="fas-chevron-left" slot="icon-only" aria-hidden="true"></ion-icon>
|
<ion-icon name="fas-chevron-left" slot="icon-only" aria-hidden="true"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { CoreCancellablePromise } from '@classes/cancellable-promise';
|
import { CoreCancellablePromise } from '@classes/cancellable-promise';
|
||||||
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
||||||
import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours';
|
import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours';
|
||||||
|
@ -33,14 +33,17 @@ export class CoreBlockSideBlocksButtonComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
@Input() contextLevel!: string;
|
@Input() contextLevel!: string;
|
||||||
@Input() instanceId!: number;
|
@Input() instanceId!: number;
|
||||||
@ViewChild('button', { read: ElementRef }) button?: ElementRef<HTMLElement>;
|
|
||||||
|
|
||||||
userTour: CoreUserTourDirectiveOptions = {
|
userTour: CoreUserTourDirectiveOptions = {
|
||||||
id: 'side-blocks-button',
|
id: 'side-blocks-button',
|
||||||
component: CoreBlockSideBlocksTourComponent,
|
component: CoreBlockSideBlocksTourComponent,
|
||||||
side: CoreUserToursSide.Start,
|
side: CoreUserToursSide.Start,
|
||||||
alignment: CoreUserToursAlignment.Center,
|
alignment: CoreUserToursAlignment.Center,
|
||||||
getFocusedElement: nativeButton => nativeButton.shadowRoot?.children[0] as HTMLElement,
|
getFocusedElement: nativeButton => {
|
||||||
|
const innerButton = Array.from(nativeButton.shadowRoot?.children ?? []).find(child => child.tagName === 'BUTTON');
|
||||||
|
|
||||||
|
return innerButton as HTMLElement ?? nativeButton;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
protected element: HTMLElement;
|
protected element: HTMLElement;
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<!-- Course Index button. -->
|
<!-- Course Index button. -->
|
||||||
<ion-fab slot="fixed" core-fab vertical="bottom" horizontal="end" *ngIf="loaded && displayCourseIndex">
|
<ion-fab slot="fixed" core-fab vertical="bottom" horizontal="end" *ngIf="loaded && displayCourseIndex">
|
||||||
<ion-fab-button (click)="openCourseIndex()" [userTour]="courseIndexTour" [attr.aria-label]="'core.course.courseindex' | translate"
|
<ion-fab-button (click)="openCourseIndex()" [userTour]="courseIndexTour" [attr.aria-label]="'core.course.courseindex' | translate"
|
||||||
color="secondary" #courseIndexFab>
|
color="secondary">
|
||||||
<ion-icon name="fas-list-ul" aria-hidden="true"></ion-icon>
|
<ion-icon name="fas-list-ul" aria-hidden="true"></ion-icon>
|
||||||
<span class="sr-only">{{'core.course.courseindex' | translate }}</span>
|
<span class="sr-only">{{'core.course.courseindex' | translate }}</span>
|
||||||
</ion-fab-button>
|
</ion-fab-button>
|
||||||
|
|
|
@ -23,7 +23,6 @@ import {
|
||||||
QueryList,
|
QueryList,
|
||||||
Type,
|
Type,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
ViewChild,
|
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-component';
|
import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-component';
|
||||||
|
@ -77,7 +76,6 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
@Input() moduleId?: number; // The module ID to scroll to. Must be inside the initial selected section.
|
@Input() moduleId?: number; // The module ID to scroll to. Must be inside the initial selected section.
|
||||||
|
|
||||||
@ViewChildren(CoreDynamicComponent) dynamicComponents?: QueryList<CoreDynamicComponent>;
|
@ViewChildren(CoreDynamicComponent) dynamicComponents?: QueryList<CoreDynamicComponent>;
|
||||||
@ViewChild('courseIndexFab', { read: ElementRef }) courseIndexFab?: ElementRef<HTMLElement>;
|
|
||||||
|
|
||||||
// All the possible component classes.
|
// All the possible component classes.
|
||||||
courseFormatComponent?: Type<unknown>;
|
courseFormatComponent?: Type<unknown>;
|
||||||
|
@ -93,7 +91,11 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
component: CoreCourseCourseIndexTourComponent,
|
component: CoreCourseCourseIndexTourComponent,
|
||||||
side: CoreUserToursSide.Top,
|
side: CoreUserToursSide.Top,
|
||||||
alignment: CoreUserToursAlignment.End,
|
alignment: CoreUserToursAlignment.End,
|
||||||
getFocusedElement: nativeButton => nativeButton.shadowRoot?.children[0] as HTMLElement,
|
getFocusedElement: nativeButton => {
|
||||||
|
const innerButton = Array.from(nativeButton.shadowRoot?.children ?? []).find(child => child.tagName === 'BUTTON');
|
||||||
|
|
||||||
|
return innerButton as HTMLElement ?? nativeButton;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
displayCourseIndex = false;
|
displayCourseIndex = false;
|
||||||
|
|
|
@ -353,7 +353,6 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon
|
||||||
* @return Promise resolved when done.
|
* @return Promise resolved when done.
|
||||||
*/
|
*/
|
||||||
protected async showLoadingAndRefresh(sync = false, invalidateData = true): Promise<void> {
|
protected async showLoadingAndRefresh(sync = false, invalidateData = true): Promise<void> {
|
||||||
// Save scroll position to restore it once done.
|
|
||||||
this.updatingData = true;
|
this.updatingData = true;
|
||||||
this.changeDetectorRef.detectChanges();
|
this.changeDetectorRef.detectChanges();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<core-user-avatar *ngIf="isMainScreen && siteInfo" [user]="siteInfo" class="core-bar-button-image clickable" [linkProfile]="false"
|
<core-user-avatar *ngIf="isMainScreen && siteInfo" [user]="siteInfo" class="core-bar-button-image clickable" [linkProfile]="false"
|
||||||
(ariaButtonClick)="openUserMenu($event)" [userTour]="userTour" role="button" tabindex="0"
|
(ariaButtonClick)="openUserMenu($event)" [userTour]="userTour" role="button" tabindex="0"
|
||||||
[attr.aria-label]="'core.user.useraccount' | translate" #avatar>
|
[attr.aria-label]="'core.user.useraccount' | translate">
|
||||||
</core-user-avatar>
|
</core-user-avatar>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { CoreSiteInfo } from '@classes/site';
|
import { CoreSiteInfo } from '@classes/site';
|
||||||
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
||||||
import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours';
|
import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours';
|
||||||
|
@ -44,8 +44,6 @@ export class CoreMainMenuUserButtonComponent implements OnInit {
|
||||||
side: CoreScreen.isMobile ? CoreUserToursSide.Start : CoreUserToursSide.End,
|
side: CoreScreen.isMobile ? CoreUserToursSide.Start : CoreUserToursSide.End,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ViewChild('avatar', { read: ElementRef }) avatar?: ElementRef<HTMLElement>;
|
|
||||||
|
|
||||||
constructor(protected routerOutlet: IonRouterOutlet) {
|
constructor(protected routerOutlet: IonRouterOutlet) {
|
||||||
const currentSite = CoreSites.getRequiredCurrentSite();
|
const currentSite = CoreSites.getRequiredCurrentSite();
|
||||||
|
|
||||||
|
|
|
@ -183,6 +183,11 @@ export class CoreUserToursUserTourComponent implements AfterViewInit, OnDestroy
|
||||||
* Play animation to show that the User Tour has started.
|
* Play animation to show that the User Tour has started.
|
||||||
*/
|
*/
|
||||||
private async playEnterAnimation(): Promise<void> {
|
private async playEnterAnimation(): Promise<void> {
|
||||||
|
if (!('animate' in this.element)) {
|
||||||
|
// Not supported, don't animate.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const animations = [
|
const animations = [
|
||||||
this.element.animate({ opacity: ['0', '1'] }, { duration: ANIMATION_DURATION }),
|
this.element.animate({ opacity: ['0', '1'] }, { duration: ANIMATION_DURATION }),
|
||||||
this.wrapperElement.value?.animate(
|
this.wrapperElement.value?.animate(
|
||||||
|
@ -198,6 +203,11 @@ export class CoreUserToursUserTourComponent implements AfterViewInit, OnDestroy
|
||||||
* Play animation to show that the User Tour has endd.
|
* Play animation to show that the User Tour has endd.
|
||||||
*/
|
*/
|
||||||
private async playLeaveAnimation(): Promise<void> {
|
private async playLeaveAnimation(): Promise<void> {
|
||||||
|
if (!('animate' in this.element)) {
|
||||||
|
// Not supported, don't animate.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const animations = [
|
const animations = [
|
||||||
this.element.animate({ opacity: ['1', '0'] }, { duration: ANIMATION_DURATION }),
|
this.element.animate({ opacity: ['1', '0'] }, { duration: ANIMATION_DURATION }),
|
||||||
this.wrapperElement.value?.animate(
|
this.wrapperElement.value?.animate(
|
||||||
|
|
Loading…
Reference in New Issue