|
|
@@ -1252,7 +1252,7 @@ var sheetCommonObj = {
|
|
|
// 获取带输入框的右键子目
|
|
|
registerInputContextMenuItem(name, html, icon, callback) {
|
|
|
$.contextMenu.types[name] = function (item, opt, root) {
|
|
|
- // 因为contextMenu有自检的键盘事件处理,因此输入框的键盘控制光标需要自己定义事件实现覆盖。
|
|
|
+ // 因为contextMenu有自己的键盘事件处理,因此输入框的键盘控制光标需要自己定义事件实现覆盖。
|
|
|
const Direction = {
|
|
|
BACKWARD: 'backward',
|
|
|
FORWARD: 'forward'
|
|
|
@@ -1260,7 +1260,7 @@ var sheetCommonObj = {
|
|
|
function moveLeft(input, isShifting) {
|
|
|
const start = input.selectionStart;
|
|
|
const end = input.selectionEnd;
|
|
|
- let direction = end === start ? Direction.BACKWARD : input.selectionDirection;
|
|
|
+ const direction = end === start ? Direction.BACKWARD : input.selectionDirection;
|
|
|
if (isShifting) {
|
|
|
if (direction === Direction.FORWARD) {
|
|
|
const curEnd = end - 1;
|
|
|
@@ -1270,7 +1270,7 @@ var sheetCommonObj = {
|
|
|
input.setSelectionRange(curStart, end, Direction.BACKWARD);
|
|
|
}
|
|
|
} else {
|
|
|
- let idx = end > start
|
|
|
+ const idx = end > start
|
|
|
? start
|
|
|
: start - 1 < 0
|
|
|
? 0
|
|
|
@@ -1291,7 +1291,7 @@ var sheetCommonObj = {
|
|
|
input.setSelectionRange(start, curEnd, Direction.FORWARD);
|
|
|
}
|
|
|
} else {
|
|
|
- let idx = start < end
|
|
|
+ const idx = start < end
|
|
|
? end
|
|
|
: end + 1
|
|
|
input.setSelectionRange(idx, idx);
|