Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
c8d0db11
Commit
c8d0db11
authored
Feb 16, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix autoComplete state
parent
78898f9f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
cell/view/CellEditorView.js
cell/view/CellEditorView.js
+8
-2
No files found.
cell/view/CellEditorView.js
View file @
c8d0db11
...
@@ -154,6 +154,7 @@
...
@@ -154,6 +154,7 @@
//-----------------
//-----------------
this
.
objAutoComplete
=
{};
this
.
objAutoComplete
=
{};
this
.
isAutoComplete
=
false
;
/** @type RegExp */
/** @type RegExp */
this
.
reReplaceNL
=
/
\r?\n
|
\r
/g
;
this
.
reReplaceNL
=
/
\r?\n
|
\r
/g
;
...
@@ -187,6 +188,7 @@
...
@@ -187,6 +188,7 @@
var
t
=
this
;
var
t
=
this
;
var
z
=
t
.
defaults
.
canvasZIndex
;
var
z
=
t
.
defaults
.
canvasZIndex
;
this
.
defaults
.
padding
=
settings
.
padding
;
this
.
defaults
.
padding
=
settings
.
padding
;
this
.
isAutoComplete
=
false
;
if
(
null
!=
this
.
element
)
{
if
(
null
!=
this
.
element
)
{
t
.
canvasOuter
=
document
.
createElement
(
'
div
'
);
t
.
canvasOuter
=
document
.
createElement
(
'
div
'
);
...
@@ -328,7 +330,7 @@
...
@@ -328,7 +330,7 @@
// Иначе F2 по ячейке с '\n', у которой выключен wrap, не станет снова wrap. http://bugzilla.onlyoffice.com/show_bug.cgi?id=17590
// Иначе F2 по ячейке с '\n', у которой выключен wrap, не станет снова wrap. http://bugzilla.onlyoffice.com/show_bug.cgi?id=17590
if
(
0
<
this
.
undoList
.
length
||
isFormula
||
this
.
textFlags
.
wrapOnlyNL
)
{
if
(
0
<
this
.
undoList
.
length
||
isFormula
||
this
.
textFlags
.
wrapOnlyNL
)
{
// Делаем замену текста на автодополнение, если есть select и текст полностью совпал.
// Делаем замену текста на автодополнение, если есть select и текст полностью совпал.
if
(
this
.
selectionBegin
!==
this
.
selectionEnd
&&
!
isFormula
)
{
if
(
this
.
isAutoComplete
&&
!
isFormula
)
{
var
s
=
this
.
_getFragmentsText
(
this
.
options
.
fragments
);
var
s
=
this
.
_getFragmentsText
(
this
.
options
.
fragments
);
if
(
!
AscCommon
.
isNumber
(
s
))
{
if
(
!
AscCommon
.
isNumber
(
s
))
{
var
arrAutoComplete
=
this
.
_getAutoComplete
(
s
.
toLowerCase
());
var
arrAutoComplete
=
this
.
_getAutoComplete
(
s
.
toLowerCase
());
...
@@ -1499,6 +1501,7 @@
...
@@ -1499,6 +1501,7 @@
CellEditor
.
prototype
.
_moveCursor
=
function
(
kind
,
pos
)
{
CellEditor
.
prototype
.
_moveCursor
=
function
(
kind
,
pos
)
{
var
t
=
this
;
var
t
=
this
;
this
.
isAutoComplete
=
false
;
switch
(
kind
)
{
switch
(
kind
)
{
case
kPrevChar
:
case
kPrevChar
:
t
.
cursorPos
=
t
.
textRender
.
getPrevChar
(
t
.
cursorPos
);
t
.
cursorPos
=
t
.
textRender
.
getPrevChar
(
t
.
cursorPos
);
...
@@ -1670,6 +1673,7 @@
...
@@ -1670,6 +1673,7 @@
return
false
;
return
false
;
}
}
this
.
isAutoComplete
=
false
;
this
.
dontUpdateText
=
true
;
this
.
dontUpdateText
=
true
;
if
(
this
.
selectionBegin
!==
this
.
selectionEnd
)
{
if
(
this
.
selectionBegin
!==
this
.
selectionEnd
)
{
...
@@ -1796,6 +1800,7 @@
...
@@ -1796,6 +1800,7 @@
var
t
=
this
;
var
t
=
this
;
var
begPos
,
endPos
;
var
begPos
,
endPos
;
this
.
isAutoComplete
=
false
;
begPos
=
t
.
selectionBegin
===
t
.
selectionEnd
?
t
.
cursorPos
:
t
.
selectionBegin
;
begPos
=
t
.
selectionBegin
===
t
.
selectionEnd
?
t
.
cursorPos
:
t
.
selectionBegin
;
t
.
_moveCursor
(
kind
,
pos
);
t
.
_moveCursor
(
kind
,
pos
);
endPos
=
t
.
cursorPos
;
endPos
=
t
.
cursorPos
;
...
@@ -2568,11 +2573,12 @@
...
@@ -2568,11 +2573,12 @@
t
.
_addChars
(
newValue
.
substring
(
lengthInput
));
t
.
_addChars
(
newValue
.
substring
(
lengthInput
));
t
.
selectionBegin
=
tmpCursorPos
;
t
.
selectionBegin
=
tmpCursorPos
;
t
.
_selectChars
(
kEndOfText
);
t
.
_selectChars
(
kEndOfText
);
this
.
isAutoComplete
=
true
;
}
}
}
}
}
}
return
t
.
isTopLineActive
?
true
:
false
;
// prevent event bubbling
return
t
.
isTopLineActive
;
// prevent event bubbling
};
};
/** @param event {KeyboardEvent} */
/** @param event {KeyboardEvent} */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment