MCPcopy Create free account
hub / github.com/Fiddle-Digital/string-scroll / resize

Method resize

src/Scrollbar/StringScrollbar.ts:41–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 public resize(){
42 const contentHeight = document.documentElement.scrollHeight;
43 const visibleHeight = window.innerHeight;
44 const thumbHeight = visibleHeight / contentHeight * visibleHeight;
45 this.thumb.style.setProperty('--height', thumbHeight + 'px');
46
47 if (contentHeight <= visibleHeight) {
48 this.scrollbar.classList.add('-hide')
49 } else {
50 this.scrollbar.classList.remove('-hide')
51 }
52 }
53
54 private updateThumb() {
55 const contentHeight = document.documentElement.scrollHeight;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected