MCPcopy
hub / github.com/stutrek/scrollmonitor / calculateViewport

Method calculateViewport

src/container.ts:104–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103 var calculateViewportI;
104 function calculateViewport() {
105 self.viewportTop = scrollTop(item);
106 self.viewportBottom = self.viewportTop + self.viewportHeight;
107 self.documentHeight = getContentHeight(item);
108 if (self.documentHeight !== previousDocumentHeight) {
109 calculateViewportI = self.watchers.length;
110 while (calculateViewportI--) {
111 self.watchers[calculateViewportI].recalculateLocation();
112 }
113 previousDocumentHeight = self.documentHeight;
114 }
115 }
116
117 var updateAndTriggerWatchersI;
118 function updateAndTriggerWatchers() {

Callers

nothing calls this directly

Calls 2

scrollTopFunction · 0.85
getContentHeightFunction · 0.85

Tested by

no test coverage detected