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
7539e1a6
Commit
7539e1a6
authored
Jan 24, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile (web): 1) keyboard hide/show, 2) GetNearestPos bug, 3) presentations bugs
parent
959222f1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
242 additions
and
55 deletions
+242
-55
cell/view/mobileTouch.js
cell/view/mobileTouch.js
+57
-16
common/Scrolls/iscroll.js
common/Scrolls/iscroll.js
+4
-1
common/Scrolls/mobileTouchManagerBase.js
common/Scrolls/mobileTouchManagerBase.js
+11
-4
common/text_input.js
common/text_input.js
+54
-0
slide/Drawing/mobileTouchManager.js
slide/Drawing/mobileTouchManager.js
+58
-17
word/Drawing/mobileTouchManager.js
word/Drawing/mobileTouchManager.js
+58
-17
No files found.
cell/view/mobileTouch.js
View file @
7539e1a6
...
...
@@ -382,6 +382,7 @@ function (window, undefined)
{
var
_e
=
e
.
touches
?
e
.
touches
[
0
]
:
e
;
this
.
IsTouching
=
true
;
AscCommon
.
g_inputContext
.
enableVirtualKeyboard
();
global_mouseEvent
.
KoefPixToMM
=
5
;
AscCommon
.
check_MouseDownEvent
(
_e
,
true
);
...
...
@@ -427,6 +428,29 @@ function (window, undefined)
break
;
}
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
InlineObj
:
case
AscCommon
.
MobileTouchMode
.
FlowObj
:
case
AscCommon
.
MobileTouchMode
.
Zoom
:
case
AscCommon
.
MobileTouchMode
.
TableMove
:
{
isPreventDefault
=
true
;
break
;
}
case
AscCommon
.
MobileTouchMode
.
None
:
case
AscCommon
.
MobileTouchMode
.
Scroll
:
{
isPreventDefault
=
this
.
CheckObjectTrackBefore
();
break
;
}
default
:
{
break
;
}
}
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
None
:
...
...
@@ -533,14 +557,13 @@ function (window, undefined)
}
}
if
(
this
.
Api
.
isViewMode
)
{
if
(
e
.
preventDefault
)
e
.
preventDefault
();
else
e
.
returnValue
=
false
;
return
false
;
}
if
(
AscCommon
.
AscBrowser
.
isAndroid
)
isPreventDefault
=
false
;
if
(
this
.
Api
.
isViewMode
||
isPreventDefault
)
AscCommon
.
stopEvent
(
e
);
return
false
;
};
CMobileTouchManager
.
prototype
.
onTouchMove
=
function
(
e
)
{
...
...
@@ -645,6 +668,24 @@ function (window, undefined)
var
isCheckContextMenuMode
=
true
;
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
Scroll
:
case
AscCommon
.
MobileTouchMode
.
InlineObj
:
case
AscCommon
.
MobileTouchMode
.
FlowObj
:
case
AscCommon
.
MobileTouchMode
.
Zoom
:
case
AscCommon
.
MobileTouchMode
.
TableMove
:
{
isPreventDefault
=
true
;
break
;
}
default
:
{
break
;
}
}
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
Cursor
:
...
...
@@ -661,6 +702,10 @@ function (window, undefined)
this
.
delegate
.
Drawing_OnMouseDown
(
_e
);
this
.
delegate
.
Drawing_OnMouseUp
(
_e
);
this
.
Api
.
sendEvent
(
"
asc_onTapEvent
"
,
e
);
var
typeMenu
=
this
.
delegate
.
GetContextMenuType
();
if
(
typeMenu
==
AscCommon
.
MobileTouchContextMenuType
.
Target
)
isPreventDefault
=
false
;
}
else
{
...
...
@@ -704,17 +749,13 @@ function (window, undefined)
break
;
}
if
(
this
.
Api
.
isViewMode
)
{
if
(
e
.
preventDefault
)
e
.
preventDefault
();
else
e
.
returnValue
=
false
;
return
false
;
}
if
(
this
.
Api
.
isViewMode
||
isPreventDefault
)
AscCommon
.
g_inputContext
.
preventVirtualKeyboard
(
e
);
if
(
true
!==
this
.
iScroll
.
isAnimating
)
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
);
return
false
;
};
CMobileTouchManager
.
prototype
.
mainOnTouchStart
=
function
(
e
)
...
...
common/Scrolls/iscroll.js
View file @
7539e1a6
...
...
@@ -1647,7 +1647,10 @@ IScroll.prototype = {
case
'
pointermove
'
:
case
'
MSPointerMove
'
:
case
'
mousemove
'
:
this
.
eventsElement
?
this
.
manager
.
mainOnTouchMove
(
e
)
:
(
e
);
if
(
this
.
isDown
||
e
.
srcElement
==
this
.
eventsElement
)
{
this
.
eventsElement
?
this
.
manager
.
mainOnTouchMove
(
e
)
:
(
e
);
}
break
;
case
'
touchend
'
:
case
'
pointerup
'
:
...
...
common/Scrolls/mobileTouchManagerBase.js
View file @
7539e1a6
...
...
@@ -126,7 +126,7 @@
CMobileDelegateSimple
.
prototype
.
SetZoom
=
function
(
_value
)
{
};
CMobileDelegateSimple
.
prototype
.
GetObjectTrack
=
function
(
x
,
y
,
page
)
CMobileDelegateSimple
.
prototype
.
GetObjectTrack
=
function
(
x
,
y
,
page
,
bSelected
)
{
return
false
;
};
...
...
@@ -820,10 +820,8 @@
CMobileTouchManagerBase
.
prototype
.
CheckObjectTrack
=
function
()
{
var
pos
=
this
.
delegate
.
ConvertCoordsFromCursor
(
global_mouseEvent
.
X
,
global_mouseEvent
.
Y
);
var
dKoef
=
(
100
*
AscCommon
.
g_dKoef_pix_to_mm
/
this
.
delegate
.
GetZoom
());
global_mouseEvent
.
KoefPixToMM
=
5
;
if
(
this
.
delegate
.
GetObjectTrack
(
pos
.
X
,
pos
.
Y
,
pos
.
Page
))
if
(
this
.
delegate
.
GetObjectTrack
(
pos
.
X
,
pos
.
Y
,
pos
.
Page
,
true
))
{
this
.
Mode
=
AscCommon
.
MobileTouchMode
.
FlowObj
;
}
...
...
@@ -836,6 +834,15 @@
return
(
AscCommon
.
MobileTouchMode
.
FlowObj
==
this
.
Mode
);
};
CMobileTouchManagerBase
.
prototype
.
CheckObjectTrackBefore
=
function
()
{
var
pos
=
this
.
delegate
.
ConvertCoordsFromCursor
(
global_mouseEvent
.
X
,
global_mouseEvent
.
Y
);
global_mouseEvent
.
KoefPixToMM
=
5
;
var
bResult
=
this
.
delegate
.
GetObjectTrack
(
pos
.
X
,
pos
.
Y
,
pos
.
Page
,
false
);
global_mouseEvent
.
KoefPixToMM
=
1
;
return
bResult
;
};
// в мобильной версии - меньше, чем "по ширине" - не делаем
CMobileTouchManagerBase
.
prototype
.
CheckZoomCriticalValues
=
function
(
zoomMin
)
{
...
...
common/text_input.js
View file @
7539e1a6
...
...
@@ -162,6 +162,9 @@
this
.
IsInitialInputContext
=
false
;
this
.
IsDisableKeyPress
=
false
;
this
.
virtualKeyboardClickTimeout
=
-
1
;
this
.
virtualKeyboardClickPrevent
=
false
;
}
CTextInput
.
prototype
=
...
...
@@ -308,6 +311,33 @@
*/
this
.
Api
.
Input_UpdatePos
();
if
(
AscCommon
.
AscBrowser
.
isAndroid
)
{
this
.
HtmlArea
.
onclick
=
function
(
e
)
{
var
_this
=
AscCommon
.
g_inputContext
;
if
(
-
1
!=
_this
.
virtualKeyboardClickTimeout
)
{
clearTimeout
(
_this
.
virtualKeyboardClickTimeout
);
_this
.
virtualKeyboardClickTimeout
=
-
1
;
}
if
(
!
_this
.
virtualKeyboardClickPrevent
)
return
;
_this
.
HtmlArea
.
readOnly
=
true
;
_this
.
virtualKeyboardClickPrevent
=
false
;
AscCommon
.
stopEvent
(
e
);
_this
.
virtualKeyboardClickTimeout
=
setTimeout
(
function
()
{
_this
.
HtmlArea
.
readOnly
=
false
;
_this
.
virtualKeyboardClickTimeout
=
-
1
;
},
1
);
return
false
;
};
}
},
onResize
:
function
(
_editorContainerId
)
...
...
@@ -1656,6 +1686,30 @@
},
10
);
return
true
;
},
preventVirtualKeyboard
:
function
(
e
)
{
//AscCommon.stopEvent(e);
if
(
AscCommon
.
AscBrowser
.
isAndroid
)
{
this
.
virtualKeyboardClickPrevent
=
true
;
}
},
enableVirtualKeyboard
:
function
()
{
if
(
AscCommon
.
AscBrowser
.
isAndroid
)
{
if
(
-
1
!=
this
.
virtualKeyboardClickTimeout
)
{
clearTimeout
(
this
.
virtualKeyboardClickTimeout
);
this
.
virtualKeyboardClickTimeout
=
-
1
;
}
this
.
virtualKeyboardClickPrevent
=
false
;
}
}
};
...
...
slide/Drawing/mobileTouchManager.js
View file @
7539e1a6
...
...
@@ -275,6 +275,7 @@
CMobileTouchManager
.
prototype
.
onTouchStart
=
function
(
e
)
{
this
.
IsTouching
=
true
;
AscCommon
.
g_inputContext
.
enableVirtualKeyboard
();
if
(
this
.
delegate
.
IsReader
())
return
this
.
onTouchStart_renderer
(
e
);
...
...
@@ -329,6 +330,29 @@
break
;
}
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
InlineObj
:
case
AscCommon
.
MobileTouchMode
.
FlowObj
:
case
AscCommon
.
MobileTouchMode
.
Zoom
:
case
AscCommon
.
MobileTouchMode
.
TableMove
:
{
isPreventDefault
=
true
;
break
;
}
case
AscCommon
.
MobileTouchMode
.
None
:
case
AscCommon
.
MobileTouchMode
.
Scroll
:
{
isPreventDefault
=
this
.
CheckObjectTrackBefore
();
break
;
}
default
:
{
break
;
}
}
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
None
:
...
...
@@ -450,14 +474,13 @@
}
}
if
(
this
.
Api
.
isViewMode
)
{
if
(
e
.
preventDefault
)
e
.
preventDefault
();
else
e
.
returnValue
=
false
;
return
false
;
}
if
(
AscCommon
.
AscBrowser
.
isAndroid
)
isPreventDefault
=
false
;
if
(
this
.
Api
.
isViewMode
||
isPreventDefault
)
AscCommon
.
stopEvent
(
e
);
return
false
;
};
CMobileTouchManager
.
prototype
.
onTouchMove
=
function
(
e
)
{
...
...
@@ -630,6 +653,24 @@
var
isCheckContextMenuMode
=
true
;
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
Scroll
:
case
AscCommon
.
MobileTouchMode
.
InlineObj
:
case
AscCommon
.
MobileTouchMode
.
FlowObj
:
case
AscCommon
.
MobileTouchMode
.
Zoom
:
case
AscCommon
.
MobileTouchMode
.
TableMove
:
{
isPreventDefault
=
true
;
break
;
}
default
:
{
break
;
}
}
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
Cursor
:
...
...
@@ -646,6 +687,10 @@
this
.
delegate
.
Drawing_OnMouseDown
(
_e
);
this
.
delegate
.
Drawing_OnMouseUp
(
_e
);
this
.
Api
.
sendEvent
(
"
asc_onTapEvent
"
,
e
);
var
typeMenu
=
this
.
delegate
.
GetContextMenuType
();
if
(
typeMenu
==
AscCommon
.
MobileTouchContextMenuType
.
Target
)
isPreventDefault
=
false
;
}
else
{
...
...
@@ -794,17 +839,13 @@
break
;
}
if
(
this
.
Api
.
isViewMode
)
{
if
(
e
.
preventDefault
)
e
.
preventDefault
();
else
e
.
returnValue
=
false
;
return
false
;
}
if
(
this
.
Api
.
isViewMode
||
isPreventDefault
)
AscCommon
.
g_inputContext
.
preventVirtualKeyboard
(
e
);
if
(
true
!==
this
.
iScroll
.
isAnimating
)
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
);
return
false
;
};
CMobileTouchManager
.
prototype
.
mainOnTouchStart
=
function
(
e
)
...
...
@@ -812,7 +853,7 @@
if
(
AscCommon
.
g_inputContext
&&
AscCommon
.
g_inputContext
.
externalChangeFocus
())
return
;
if
(
!
this
.
Api
.
IsFocus
)
if
(
!
this
.
Api
.
asc_IsFocus
()
)
this
.
Api
.
asc_enableKeyEvents
(
true
);
var
oWordControl
=
this
.
Api
.
WordControl
;
...
...
word/Drawing/mobileTouchManager.js
View file @
7539e1a6
...
...
@@ -81,6 +81,7 @@
CMobileTouchManager
.
prototype
.
onTouchStart
=
function
(
e
)
{
this
.
IsTouching
=
true
;
AscCommon
.
g_inputContext
.
enableVirtualKeyboard
();
if
(
this
.
delegate
.
IsReader
())
return
this
.
onTouchStart_renderer
(
e
);
...
...
@@ -135,6 +136,29 @@
break
;
}
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
InlineObj
:
case
AscCommon
.
MobileTouchMode
.
FlowObj
:
case
AscCommon
.
MobileTouchMode
.
Zoom
:
case
AscCommon
.
MobileTouchMode
.
TableMove
:
{
isPreventDefault
=
true
;
break
;
}
case
AscCommon
.
MobileTouchMode
.
None
:
case
AscCommon
.
MobileTouchMode
.
Scroll
:
{
isPreventDefault
=
this
.
CheckObjectTrackBefore
();
break
;
}
default
:
{
break
;
}
}
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
None
:
...
...
@@ -256,14 +280,13 @@
}
}
if
(
this
.
Api
.
isViewMode
)
{
if
(
e
.
preventDefault
)
e
.
preventDefault
();
else
e
.
returnValue
=
false
;
return
false
;
}
if
(
AscCommon
.
AscBrowser
.
isAndroid
)
isPreventDefault
=
false
;
if
(
this
.
Api
.
isViewMode
||
isPreventDefault
)
AscCommon
.
stopEvent
(
e
);
return
false
;
};
CMobileTouchManager
.
prototype
.
onTouchMove
=
function
(
e
)
{
...
...
@@ -436,6 +459,24 @@
var
isCheckContextMenuMode
=
true
;
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
Scroll
:
case
AscCommon
.
MobileTouchMode
.
InlineObj
:
case
AscCommon
.
MobileTouchMode
.
FlowObj
:
case
AscCommon
.
MobileTouchMode
.
Zoom
:
case
AscCommon
.
MobileTouchMode
.
TableMove
:
{
isPreventDefault
=
true
;
break
;
}
default
:
{
break
;
}
}
switch
(
this
.
Mode
)
{
case
AscCommon
.
MobileTouchMode
.
Cursor
:
...
...
@@ -452,6 +493,10 @@
this
.
delegate
.
Drawing_OnMouseDown
(
_e
);
this
.
delegate
.
Drawing_OnMouseUp
(
_e
);
this
.
Api
.
sendEvent
(
"
asc_onTapEvent
"
,
e
);
var
typeMenu
=
this
.
delegate
.
GetContextMenuType
();
if
(
typeMenu
==
AscCommon
.
MobileTouchContextMenuType
.
Target
)
isPreventDefault
=
false
;
}
else
{
...
...
@@ -600,17 +645,13 @@
break
;
}
if
(
this
.
Api
.
isViewMode
)
{
if
(
e
.
preventDefault
)
e
.
preventDefault
();
else
e
.
returnValue
=
false
;
return
false
;
}
if
(
this
.
Api
.
isViewMode
||
isPreventDefault
)
AscCommon
.
g_inputContext
.
preventVirtualKeyboard
(
e
);
if
(
true
!==
this
.
iScroll
.
isAnimating
)
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
);
return
false
;
};
CMobileTouchManager
.
prototype
.
mainOnTouchStart
=
function
(
e
)
...
...
@@ -618,7 +659,7 @@
if
(
AscCommon
.
g_inputContext
&&
AscCommon
.
g_inputContext
.
externalChangeFocus
())
return
;
if
(
!
this
.
Api
.
IsFocus
)
if
(
!
this
.
Api
.
asc_IsFocus
()
)
this
.
Api
.
asc_enableKeyEvents
(
true
);
var
oWordControl
=
this
.
Api
.
WordControl
;
...
...
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