MOBILE-3814 rte: Fix hover style on rte item

main
Pau Ferrer Ocaña 2022-03-18 16:20:56 +01:00
parent 9bcbdfd3c6
commit d727c53621
2 changed files with 13 additions and 13 deletions

View File

@ -20,7 +20,6 @@ import {
ViewChild,
ElementRef,
OnInit,
AfterContentInit,
OnDestroy,
Optional,
AfterViewInit,
@ -56,7 +55,7 @@ import { CoreCancellablePromise } from '@classes/cancellable-promise';
templateUrl: 'core-editor-rich-text-editor.html',
styleUrls: ['rich-text-editor.scss'],
})
export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentInit, AfterViewInit, OnDestroy {
export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit, OnDestroy {
// Based on: https://github.com/judgewest2000/Ionic3RichText/
// @todo: Anchor button, fullscreen...
@ -149,7 +148,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentIn
}
/**
* Component being initialized.
* @inheritdoc
*/
ngOnInit(): void {
this.canScanQR = CoreUtils.canScanQR();
@ -159,9 +158,9 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentIn
}
/**
* Init editor.
* @inheritdoc
*/
async ngAfterContentInit(): Promise<void> {
async ngAfterViewInit(): Promise<void> {
this.rteEnabled = await CoreDomUtils.isRichTextEditorEnabled();
await this.waitLoadingsDone();
@ -202,13 +201,14 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterContentIn
this.deleteDraftOnSubmitOrCancel();
}
}
/**
* @inheritdoc
*/
async ngAfterViewInit(): Promise<void> {
const label = this.element.closest('ion-item')?.querySelector('ion-label');
const ionItem = this.element.closest<HTMLIonItemElement>('ion-item');
if (!ionItem) {
return;
}
ionItem.classList.add('item-rte');
const label = ionItem.querySelector('ion-label');
if (!label) {
return;

View File

@ -1255,7 +1255,7 @@ ion-datetime.datetime-disabled {
// Make links clickable when inside radio or checkbox items. Style part.
@media (hover: hover) {
ion-item.item-multiple-inputs:hover::part(native) {
ion-item.item-multiple-inputs:not(.item-rte):hover::part(native) {
color: var(--color-hover);
&::after {
@ -1276,7 +1276,7 @@ ion-datetime.datetime-disabled {
// It fixes the click on links where ion-ripple-effect is present.
// Make links clickable when inside radio or checkbox items. Pointer and cursor part.
ion-item.item-multiple-inputs:not(.only-links),
ion-item.item-multiple-inputs:not(.only-links):not(.item-rte),
ion-item.ion-activatable:not(.only-links) {
cursor: pointer;
ion-label {