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
bd0de5bd
Commit
bd0de5bd
authored
Mar 17, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android new input
parent
f7e2b737
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
1 deletion
+69
-1
common/text_input.js
common/text_input.js
+69
-1
No files found.
common/text_input.js
View file @
bd0de5bd
...
...
@@ -167,6 +167,10 @@
this
.
virtualKeyboardClickPrevent
=
false
;
this
.
AndroidKeyboardDetectBackspace
=
false
;
// если этот флаг включен - то мы не следим за датой в onCompositionUpdate
// а смотрим .value на старте и энде. а промежуток - разница между этим
this
.
UseValueInComposition
=
AscCommon
.
AscBrowser
.
isAndroid
;
}
CTextInput
.
prototype
=
...
...
@@ -647,6 +651,20 @@
}
var
_value
=
this
.
getAreaValue
();
if
(
this
.
UseValueInComposition
)
{
if
(
c_oCompositionState
.
process
==
this
.
compositionState
)
{
var
_data
=
_value
.
substring
(
this
.
ieNonCompositionPrefix
.
length
);
this
.
onCompositionUpdate
(
e
,
false
,
_data
,
false
);
if
(
this
.
TextInputAfterComposition
)
{
this
.
onCompositionEnd
(
e
,
_data
);
}
}
}
if
(
!
this
.
KeyDownFlag
&&
c_oCompositionState
.
end
==
this
.
compositionState
&&
!
this
.
TextInputAfterComposition
&&
_value
!=
""
&&
_value
!=
this
.
ieNonCompositionPrefixConfirm
)
{
ti_console_log
(
"
ti: external input
"
);
...
...
@@ -1240,6 +1258,9 @@
//console.log("[apiCompositeStart]");
this
.
Api
.
Begin_CompositeInput
();
this
.
compositionStateApi
=
c_oCompositionState
.
process
;
if
(
this
.
UseValueInComposition
)
this
.
ieNonCompositionPrefix
=
this
.
getAreaValue
();
},
apiCompositeReplace
:
function
(
_value
)
...
...
@@ -1286,6 +1307,12 @@
return
;
}
if
(
this
.
UseValueInComposition
)
{
this
.
apiCompositeStart
();
return
;
}
ti_console_log2
(
"
begin
"
);
if
(
this
.
compositionState
==
c_oCompositionState
.
end
)
this
.
apiCompositeStart
();
...
...
@@ -1342,6 +1369,12 @@
return
;
}
if
(
this
.
UseValueInComposition
&&
undefined
===
_data
)
{
this
.
compositionState
=
c_oCompositionState
.
process
;
return
;
}
ti_console_log
(
"
ti: onCompositionUpdate:
"
+
e
.
data
);
var
_old
=
this
.
compositionValue
.
splice
(
0
);
...
...
@@ -1614,6 +1647,13 @@
return
;
}
var
isUseData
=
(
_data
!==
undefined
);
if
(
this
.
UseValueInComposition
)
{
var
_dataNew
=
this
.
getAreaValue
();
_data
=
_dataNew
.
substring
(
this
.
ieNonCompositionPrefix
.
length
);
}
ti_console_log
(
"
ti: onCompositionEnd
"
);
if
(
!
this
.
IsUseFirstTextInputAfterComposition
&&
this
.
isWaitFirstTextInputEvent
(
e
))
...
...
@@ -1651,7 +1691,30 @@
}
else
{
this
.
apiCompositeEnd
();
if
(
this
.
UseValueInComposition
)
{
if
(
isUseData
)
this
.
apiCompositeEnd
();
else
{
setTimeout
(
function
()
{
var
_context
=
AscCommon
.
g_inputContext
;
if
(
_context
.
TextInputAfterComposition
)
{
var
_value
=
_context
.
getAreaValue
();
var
_data
=
_value
.
substring
(
_context
.
ieNonCompositionPrefix
.
length
);
_context
.
onCompositionEnd
({
data
:
"
nonWait
"
},
_data
);
_context
.
clear
();
}
},
50
);
}
}
else
{
this
.
apiCompositeEnd
();
}
}
this
.
unlockTarget
();
...
...
@@ -1724,6 +1787,11 @@
return
true
;
},
isCompositionProcess
:
function
()
{
return
this
.
compositionState
==
c_oCompositionState
.
process
;
},
preventVirtualKeyboard
:
function
(
e
)
{
//AscCommon.stopEvent(e);
...
...
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