Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to getSize Function #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/js/components/vue-scrollbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,24 @@
this.dragging = false
},

getSize(){
getSize: function getSize () {
// The Elements
let $scrollArea = this.$refs.scrollArea
let $scrollWrapper = this.$refs.scrollWrapper
var $scrollArea = this.$refs.scrollArea;
var $scrollWrapper = this.$refs.scrollWrapper;

var $height = $scrollArea.children[0] ? $scrollArea.children[0].clientHeight : 0;
var $width = $scrollArea.children[0] ? $scrollArea.children[0].clientWidth : 0;
// Get new Elements Size
let elementSize = {
var elementSize = {
// Scroll Area Height and Width
scrollAreaHeight: $scrollArea.children[0].clientHeight,
scrollAreaWidth: $scrollArea.children[0].clientWidth,
scrollAreaHeight: $height,
scrollAreaWidth: $width,

// Scroll Wrapper Height and Width
scrollWrapperHeight: $scrollWrapper.clientHeight,
scrollWrapperWidth: $scrollWrapper.clientWidth,
}
return elementSize
scrollWrapperWidth: $scrollWrapper.clientWidth
};
return elementSize;
},

calculateSize(cb){
Expand Down