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

add test to see if scrollbar is needed #43

Open
amaau opened this issue Apr 6, 2017 · 0 comments
Open

add test to see if scrollbar is needed #43

amaau opened this issue Apr 6, 2017 · 0 comments

Comments

@amaau
Copy link

amaau commented Apr 6, 2017

in update function, something like

this._viewElement.style.height = ((this.element.offsetHeight + SCROLLBAR_WIDTH).toString() + 'px');
this._viewElement.style.width = ((this.element.offsetWidth + SCROLLBAR_WIDTH).toString() + 'px');

const needY = this.element.offsetHeight < this._viewElement.scrollHeight;
const needX = this.element.offsetWidth <  this._viewElement.scrollWidth;

if (needY){
	if (!this.needY) this._scrollbarVerticalElement.style.display = '';
	//here all thumb size calculation
}else if (this.needY){
	this._scrollbarVerticalElement.style.display = 'none';
}
this.needY = needY

//samething for needX

if (needX || needY) this._scrollHandler();
return this;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant