(first = false)
| 669 | var rightSize = {}; // Right content size |
| 670 | |
| 671 | function calculateView(first = false) |
| 672 | { |
| 673 | let contentRight = template._contentRight(); |
| 674 | |
| 675 | let content = contentRight.firstElementChild; |
| 676 | let rect = content.getBoundingClientRect(); |
| 677 | |
| 678 | rightSize = { |
| 679 | height: rect.height, |
| 680 | width: rect.width, |
| 681 | top: rect.top, |
| 682 | left: rect.left, |
| 683 | // readingRect: content.querySelector('.reading-body').getBoundingClientRect(), |
| 684 | scrollHeight: content.scrollHeight, |
| 685 | }; |
| 686 | |
| 687 | if(readingViewIs('compact')) |
| 688 | { |
| 689 | dom.this(contentRight).find('.reading-body > div, .reading-lens > div > div', true).css({ |
| 690 | width: rect.width+'px', |
| 691 | height: rect.height+'px', |
| 692 | flexDirection: '', |
| 693 | }).addClass('compact', readingView()); |
| 694 | } |
| 695 | else if(readingViewIs('slide')) |
| 696 | { |
| 697 | dom.this(contentRight).find('.reading-body > div, .reading-lens > div > div', true).css({ |
| 698 | width: (rect.width * indexNum)+'px', |
| 699 | height: rect.height+'px', |
| 700 | flexDirection: '', |
| 701 | }).removeClass('compact', 'fade', 'rough-page-turn', 'smooth-page-turn'); |
| 702 | } |
| 703 | else if(readingViewIs('scroll')) |
| 704 | { |
| 705 | dom.this(contentRight).find('.reading-body > div').css({ |
| 706 | width: '100%', |
| 707 | flexDirection: 'column', |
| 708 | }).removeClass('compact', 'fade', 'rough-page-turn', 'smooth-page-turn'); |
| 709 | |
| 710 | dom.this(contentRight).find('.reading-lens > div > div').css({ |
| 711 | width: rect.width+'px', |
| 712 | flexDirection: 'column', |
| 713 | }).removeClass('compact', 'fade', 'rough-page-turn', 'smooth-page-turn'); |
| 714 | |
| 715 | rect = content.getBoundingClientRect(); |
| 716 | |
| 717 | rightSize = { |
| 718 | height: rect.height, |
| 719 | width: rect.width, |
| 720 | top: rect.top, |
| 721 | left: rect.left, |
| 722 | // readingRect: content.querySelector('.reading-body').getBoundingClientRect(), |
| 723 | scrollHeight: content.scrollHeight, |
| 724 | }; |
| 725 | } |
| 726 | |
| 727 | if(readingViewIs('scroll')) |
| 728 | { |
no test coverage detected