|
630 | 630 | getSizes: function getSizes() { |
631 | 631 | return this.virtual.sizes.size; |
632 | 632 | }, |
| 633 | + // return current scroll offset |
| 634 | + getOffset: function getOffset() { |
| 635 | + var root = this.$refs.root; |
| 636 | + return root ? Math.ceil(root[this.directionKey]) : 0; |
| 637 | + }, |
| 638 | + // return client viewport size |
| 639 | + getClientSize: function getClientSize() { |
| 640 | + var root = this.$refs.root; |
| 641 | + return root ? root[this.isHorizontal ? 'clientWidth' : 'clientHeight'] : 0; |
| 642 | + }, |
| 643 | + // return all scroll size |
| 644 | + getScrollSize: function getScrollSize() { |
| 645 | + var root = this.$refs.root; |
| 646 | + return root ? root[this.isHorizontal ? 'scrollWidth' : 'scrollHeight'] : 0; |
| 647 | + }, |
633 | 648 | // set current scroll position to a expectant offset |
634 | 649 | scrollToOffset: function scrollToOffset(offset) { |
635 | 650 | var root = this.$refs.root; |
|
694 | 709 | return dataSource[_this2.dataKey]; |
695 | 710 | }); |
696 | 711 | }, |
697 | | - // return current scroll offset |
698 | | - getOffset: function getOffset() { |
699 | | - var root = this.$refs.root; |
700 | | - return root ? Math.ceil(root[this.directionKey]) : 0; |
701 | | - }, |
702 | | - // return client viewport size |
703 | | - getClientSize: function getClientSize() { |
704 | | - var root = this.$refs.root; |
705 | | - return root ? root[this.isHorizontal ? 'clientWidth' : 'clientHeight'] : 0; |
706 | | - }, |
707 | | - // return all scroll size |
708 | | - getScrollSize: function getScrollSize() { |
709 | | - var root = this.$refs.root; |
710 | | - return root ? root[this.isHorizontal ? 'scrollWidth' : 'scrollHeight'] : 0; |
711 | | - }, |
712 | 712 | // event called when each item mounted or size changed |
713 | 713 | onItemResized: function onItemResized(id, size) { |
714 | 714 | this.virtual.saveSize(id, size); |
|
0 commit comments