More EPUB Scoping Fixes (#691)
* Added better handling around when importing css files that are empty. Moved comment removal on css files to before some css whitespace cleanup to get better matches. * Some enhancements on the checks to see if we need the bottom action bar on reader. Now we don't query DOM and have something that works more reliably.
This commit is contained in:
parent
77da75f274
commit
8e3121447d
3 changed files with 24 additions and 13 deletions
|
@ -717,15 +717,7 @@ export class BookReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
setupPage(part?: string | undefined, scrollTop?: number | undefined) {
|
||||
this.isLoading = false;
|
||||
this.scrollbarNeeded = this.readingSectionElemRef.nativeElement.scrollHeight > this.readingSectionElemRef.nativeElement.clientHeight;
|
||||
|
||||
const itemsOnScreen = Array.from(this.readingHtml.nativeElement.querySelectorAll('*')).filter(elem => (elem as HTMLElement).nodeName != 'STYLE');
|
||||
const itemsWithAbsolutePositioning = itemsOnScreen.filter(elem => (elem as HTMLElement).style.getPropertyValue('position') === 'absolute').length;
|
||||
|
||||
if (itemsWithAbsolutePositioning >= itemsOnScreen.length) {
|
||||
// Supress bottom actionbar. This is because of how the html is structured, with abs positioning, it will render inside images, etc.
|
||||
this.scrollbarNeeded = false;
|
||||
}
|
||||
this.scrollbarNeeded = this.readingHtml.nativeElement.clientHeight > this.readingSectionElemRef.nativeElement.clientHeight;
|
||||
|
||||
// Find all the part ids and their top offset
|
||||
this.setupPageAnchors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue