From 4979d5a181972aaca13c375fe3bf107f139da3c1 Mon Sep 17 00:00:00 2001 From: Eli Luberoff Date: Fri, 6 Dec 2024 19:03:23 -0500 Subject: [PATCH] move "select" method to base so that we can use it in StaticMath as well --- src/mathquill.d.ts | 2 +- src/publicapi.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mathquill.d.ts b/src/mathquill.d.ts index 34751c201..0db653079 100644 --- a/src/mathquill.d.ts +++ b/src/mathquill.d.ts @@ -42,10 +42,10 @@ declare namespace MathQuill { setAriaLabel(str: string): this; blur(): this; focus(): this; + select(): this; } interface EditableMathQuill extends BaseMathQuill { - select: () => EditableMathQuill; moveToRightEnd: () => EditableMathQuill; moveToLeftEnd: () => EditableMathQuill; cmd: (latex: string) => EditableMathQuill; diff --git a/src/publicapi.ts b/src/publicapi.ts index c05ba8c01..787e1aa4e 100644 --- a/src/publicapi.ts +++ b/src/publicapi.ts @@ -359,6 +359,10 @@ function getInterface(v: number): MathQuill.v3.API | MathQuill.v1.API { if (this.__controller.editable) this.__controller.scrollHoriz(); return this; } + select() { + this.__controller.selectAll(); + return this; + } blur() { this.__controller.getTextarea().blur(); return this; @@ -376,10 +380,6 @@ function getInterface(v: number): MathQuill.v3.API | MathQuill.v1.API { this.__controller.editablesTextareaEvents(); return this; } - select() { - this.__controller.selectAll(); - return this; - } clearSelection() { this.__controller.cursor.clearSelection(); return this;