Browse Source

fix(gui-v2): lint

pull/2998/head
Wing-Kam Wong 2 years ago
parent
commit
5220ecc6a0
  1. 6
      packages/nc-gui-v2/utils/formulaUtils.ts

6
packages/nc-gui-v2/utils/formulaUtils.ts

@ -8,7 +8,7 @@ const formulaTypes = {
COND_EXP: 'conditional_expression', COND_EXP: 'conditional_expression',
} }
const formulas = { const formulas: Record<string, any> = {
AVG: { AVG: {
type: formulaTypes.NUMERIC, type: formulaTypes.NUMERIC,
validation: { validation: {
@ -404,7 +404,7 @@ function insertAtCursor(myField: typeof AntInput, myValue: string, len = 0, b =
const sel = document.createRange() as any const sel = document.createRange() as any
sel.text = myValue sel.text = myValue
} // MOZILLA and others } // MOZILLA and others
else if (myField.selectionStart || myField.selectionStart == '0') { else if (myField.selectionStart || myField.selectionStart === '0') {
const startPos = myField.selectionStart const startPos = myField.selectionStart
const endPos = myField.selectionEnd const endPos = myField.selectionEnd
myField.value = myField.value.substring(0, startPos - len) + myValue + myField.value.substring(endPos, myField.value.length) myField.value = myField.value.substring(0, startPos - len) + myValue + myField.value.substring(endPos, myField.value.length)
@ -452,7 +452,7 @@ function GetCaretPosition(ctrl: typeof AntInput) {
CaretPos = Sel.text.length CaretPos = Sel.text.length
} }
// Firefox support // Firefox support
else if (ctrl.selectionStart || ctrl.selectionStart == '0') { else if (ctrl.selectionStart || ctrl.selectionStart === '0') {
CaretPos = ctrl.selectionStart CaretPos = ctrl.selectionStart
} }
return CaretPos return CaretPos

Loading…
Cancel
Save