MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / onscrollleft

Function onscrollleft

src/lib/editorManager.js:2593–2609  ·  view source on GitHub ↗

* Handles the scroll left event. * Updates the horizontal scroll value and renders the horizontal scrollbar.

()

Source from the content-addressed store, hash-verified

2591 * Updates the horizontal scroll value and renders the horizontal scrollbar.
2592 */
2593 function onscrollleft() {
2594 if (appSettings.value.textWrap) {
2595 $hScrollbar.hide();
2596 return;
2597 }
2598 const scroller = editor?.scrollDOM;
2599 if (!scroller) return;
2600 const maxScroll = Math.max(scroller.scrollWidth - scroller.clientWidth, 0);
2601 if (maxScroll <= 0) {
2602 $hScrollbar.hide();
2603 lastScrollLeft = 0;
2604 $hScrollbar.value = 0;
2605 return;
2606 }
2607 setHScrollValue();
2608 $hScrollbar.render();
2609 }
2610
2611 function readScrollMetrics() {
2612 const scroller = editor?.scrollDOM;

Callers

nothing calls this directly

Calls 3

setHScrollValueFunction · 0.85
hideMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected