MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / onCursorY

Method onCursorY

tools/xsbug/behaviors.js:222–239  ·  view source on GitHub ↗
(code, sign)

Source from the content-addressed store, hash-verified

220 this.onCursorAfter(code, offset);
221 }
222 onCursorY(code, sign) {
223 var offset = this.onCursorBefore(code, sign);
224 if (controlKey || this.field) {
225 offset = (sign > 0) ? code.length : 0;
226 this.cursorLocation = null;
227 }
228 else {
229 if (this.cursorLocation == null)
230 this.cursorLocation = code.locate(offset);
231 this.cursorLocation.y += sign * this.cursorLocation.height;
232 if (this.cursorLocation.y < 0)
233 this.cursorLocation.y = 0;
234 else if (this.cursorLocation.y > code.height)
235 this.cursorLocation.y = code.height;
236 offset = code.hitOffset(this.cursorLocation.x, this.cursorLocation.y);
237 }
238 this.onCursorAfter(code, offset);
239 }
240 onEdited(code) {
241 }
242 onFocused(code) {

Callers 1

onKeyDownMethod · 0.95

Calls 3

onCursorBeforeMethod · 0.95
onCursorAfterMethod · 0.95
locateMethod · 0.80

Tested by

no test coverage detected