MOBILE-3746 format-text: Convert show more to ion-button
parent
35c2a569b5
commit
e1502fe0be
|
@ -256,14 +256,17 @@ export class CoreFormatTextDirective implements OnChanges {
|
|||
*/
|
||||
protected displayShowMore(): void {
|
||||
const expandInFullview = CoreUtils.isTrueOrOne(this.fullOnClick) || false;
|
||||
const showMoreDiv = document.createElement('div');
|
||||
const showMoreButton = document.createElement('ion-button');
|
||||
|
||||
showMoreDiv.classList.add('core-show-more');
|
||||
showMoreDiv.innerHTML = Translate.instant('core.showmore');
|
||||
this.element.appendChild(showMoreDiv);
|
||||
showMoreButton.classList.add('core-show-more');
|
||||
showMoreButton.setAttribute('fill', 'clear');
|
||||
showMoreButton.innerHTML = Translate.instant('core.showmore');
|
||||
this.element.appendChild(showMoreButton);
|
||||
|
||||
if (expandInFullview) {
|
||||
this.element.classList.add('core-expand-in-fullview');
|
||||
} else {
|
||||
showMoreButton.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
this.element.classList.add('core-text-formatted');
|
||||
this.element.classList.add('core-shortened');
|
||||
|
@ -624,11 +627,8 @@ export class CoreFormatTextDirective implements OnChanges {
|
|||
* "Hide" the "Show more" in the element if it's shown.
|
||||
*/
|
||||
protected hideShowMore(): void {
|
||||
const showMoreDiv = this.element.querySelector('div.core-show-more');
|
||||
|
||||
if (showMoreDiv) {
|
||||
showMoreDiv.remove();
|
||||
}
|
||||
const showMoreButton = this.element.querySelector('ion-button.core-show-more');
|
||||
showMoreButton?.remove();
|
||||
|
||||
this.element.classList.remove('core-expand-in-fullview');
|
||||
this.element.classList.remove('core-text-formatted');
|
||||
|
|
|
@ -38,6 +38,7 @@ core-format-text {
|
|||
min-height: 50px;
|
||||
|
||||
.core-show-more {
|
||||
text-transform: none;
|
||||
text-align: end;
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
|
@ -45,7 +46,7 @@ core-format-text {
|
|||
@include position(null, 0, 0, null);
|
||||
z-index: 7;
|
||||
background-color: var(--background);
|
||||
color: var(--color);
|
||||
color: var(--text-color);
|
||||
padding-left: 10px; // RTL
|
||||
}
|
||||
|
||||
|
@ -68,7 +69,7 @@ core-format-text {
|
|||
&.core-expand-in-fullview {
|
||||
.core-show-more {
|
||||
@include push-arrow-color(626262, true);
|
||||
@include padding-horizontal(null, 18px);
|
||||
@include padding-horizontal(null, 5px);
|
||||
@include background-position(end, 0, center);
|
||||
|
||||
background-repeat: no-repeat;
|
||||
|
|
Loading…
Reference in New Issue