MOBILE-3053 rte: Fix toolbar sometimes has only one button
parent
66cc892794
commit
bff2c111f3
|
@ -608,14 +608,15 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(this.toolbarSlides as any)._init) {
|
const width = this.domUtils.getElementWidth(this.toolbar.nativeElement);
|
||||||
// Slides is not initialized yet, try later.
|
|
||||||
|
if (!(this.toolbarSlides as any)._init || !width) {
|
||||||
|
// Slides is not initialized or width is not available yet, try later.
|
||||||
setTimeout(this.updateToolbarButtons.bind(this), 100);
|
setTimeout(this.updateToolbarButtons.bind(this), 100);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const width = this.domUtils.getElementWidth(this.toolbar.nativeElement);
|
|
||||||
if (width > this.toolbarSlides.length() * this.toolbarButtonWidth) {
|
if (width > this.toolbarSlides.length() * this.toolbarButtonWidth) {
|
||||||
this.numToolbarButtons = this.toolbarSlides.length();
|
this.numToolbarButtons = this.toolbarSlides.length();
|
||||||
this.toolbarArrows = false;
|
this.toolbarArrows = false;
|
||||||
|
|
Loading…
Reference in New Issue