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
fb13cf1e
Commit
fb13cf1e
authored
Jan 26, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile web: new context menu
parent
2fe5d860
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
19 deletions
+131
-19
cell/view/mobileTouch.js
cell/view/mobileTouch.js
+8
-3
common/Scrolls/mobileTouchManagerBase.js
common/Scrolls/mobileTouchManagerBase.js
+103
-9
slide/Drawing/mobileTouchManager.js
slide/Drawing/mobileTouchManager.js
+17
-6
word/Drawing/mobileTouchManager.js
word/Drawing/mobileTouchManager.js
+3
-1
No files found.
cell/view/mobileTouch.js
View file @
fb13cf1e
...
...
@@ -212,6 +212,7 @@ function (window, undefined)
_info
.
Y
=
_y
;
}
info
.
targetPos
=
_info
;
return
;
}
var
_select
=
_controller
.
Get_SelectionBounds
();
...
...
@@ -245,6 +246,7 @@ function (window, undefined)
}
info
.
selectText
=
_info
;
return
;
}
else
if
(
_selection
)
{
...
...
@@ -254,12 +256,13 @@ function (window, undefined)
W
:
_selection
.
W
,
H
:
_selection
.
H
};
return
;
}
var
_object_bounds
=
_controller
.
getSelectedObjectsBounds
();
if
(
(
0
==
_mode
)
&&
_object_bounds
)
if
(
_object_bounds
)
{
info
.
sel
ectBounds
=
{
info
.
obj
ectBounds
=
{
X
:
_object_bounds
.
minX
,
Y
:
_object_bounds
.
minY
,
R
:
_object_bounds
.
maxX
,
...
...
@@ -756,7 +759,9 @@ function (window, undefined)
}
var
isCheckContextMenuMode
=
true
;
var
isCheckContextMenuSelect
=
false
;
var
isCheckContextMenuCursor
=
(
this
.
Mode
==
AscCommon
.
MobileTouchMode
.
Cursor
);
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
...
...
@@ -845,7 +850,7 @@ function (window, undefined)
AscCommon
.
g_inputContext
.
preventVirtualKeyboard
(
e
);
if
(
true
!==
this
.
iScroll
.
isAnimating
)
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
,
isCheckContextMenuSelect
);
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
,
isCheckContextMenuSelect
,
isCheckContextMenuCursor
);
return
false
;
};
...
...
common/Scrolls/mobileTouchManagerBase.js
View file @
fb13cf1e
...
...
@@ -77,6 +77,14 @@
this
.
selectCell
=
null
;
this
.
objectBounds
=
null
;
this
.
objectSlideThumbnail
=
null
;
},
CopyTo
:
function
(
dst
)
{
dst
.
targetPos
=
this
.
targetPos
;
dst
.
selectText
=
this
.
selectText
;
dst
.
selectCell
=
this
.
selectCell
;
dst
.
objectBounds
=
this
.
objectBounds
;
dst
.
objectSlideThumbnail
=
this
.
objectSlideThumbnail
;
}
};
...
...
@@ -278,11 +286,18 @@
var
_target
=
this
.
LogicDocument
.
Is_SelectionUse
();
if
(
_target
===
false
)
{
/*
_info = {
X : this.DrawingDocument.m_dTargetX,
Y : this.DrawingDocument.m_dTargetY,
Page : this.DrawingDocument.m_lTargetPage
};
*/
_info
=
{
X
:
this
.
LogicDocument
.
TargetPos
.
X
,
Y
:
this
.
LogicDocument
.
TargetPos
.
Y
,
Page
:
this
.
LogicDocument
.
TargetPos
.
PageNum
};
_transform
=
this
.
DrawingDocument
.
TextMatrix
;
if
(
_transform
)
...
...
@@ -294,6 +309,7 @@
_info
.
Y
=
_y
;
}
info
.
targetPos
=
_info
;
return
;
}
var
_select
=
this
.
LogicDocument
.
Get_SelectionBounds
();
...
...
@@ -327,12 +343,13 @@
}
info
.
selectText
=
_info
;
return
;
}
var
_object_bounds
=
this
.
LogicDocument
.
DrawingObjects
.
getSelectedObjectsBounds
();
if
(
(
0
==
_mode
)
&&
_object_bounds
)
if
(
_object_bounds
)
{
info
.
sel
ectBounds
=
{
info
.
obj
ectBounds
=
{
X
:
_object_bounds
.
minX
,
Y
:
_object_bounds
.
minY
,
R
:
_object_bounds
.
maxX
,
...
...
@@ -579,6 +596,7 @@
/* context menu */
this
.
ContextMenuLastMode
=
AscCommon
.
MobileTouchContextMenuType
.
None
;
this
.
ContextMenuLastInfo
=
new
AscCommon
.
MobileTouchContextMenuLastInfo
();
this
.
ContextMenuLastShow
=
false
;
this
.
ContextMenuLastModeCounter
=
0
;
this
.
ContextMenuShowTimerId
=
-
1
;
...
...
@@ -1030,7 +1048,7 @@
},
500
);
};
CMobileTouchManagerBase
.
prototype
.
CheckContextMenuTouchEnd
=
function
(
isCheck
,
isSelect
Touch
)
CMobileTouchManagerBase
.
prototype
.
CheckContextMenuTouchEnd
Old
=
function
(
isCheck
,
isSelectTouch
,
isGlass
Touch
)
{
// isCheck: если пришли сюда после скролла или зума (или их анимации) - то не нужно проверять состояние редактора.
// Нужно проверять последнее сохраненной состояние
...
...
@@ -1055,7 +1073,7 @@
this
.
SendShowContextMenu
();
};
CMobileTouchManagerBase
.
prototype
.
CheckContextMenuTouchEnd
New
=
function
(
isCheck
,
isSelect
Touch
)
CMobileTouchManagerBase
.
prototype
.
CheckContextMenuTouchEnd
=
function
(
isCheck
,
isSelectTouch
,
isGlass
Touch
)
{
// isCheck: если пришли сюда после скролла или зума (или их анимации) - то не нужно проверять состояние редактора.
// Нужно проверять последнее сохраненной состояние
...
...
@@ -1064,11 +1082,15 @@
var
isSelectCell
=
false
;
if
(
isCheck
)
{
var
oldLastInfo
=
this
.
ContextMenuLastInfo
;
var
oldLastInfo
=
new
AscCommon
.
MobileTouchContextMenuLastInfo
();
this
.
ContextMenuLastInfo
.
CopyTo
(
oldLastInfo
);
var
oldLasdMode
=
this
.
ContextMenuLastMode
;
this
.
ContextMenuLastMode
=
this
.
delegate
.
GetContextMenuType
();
this
.
delagate
.
GetContextMenuInfo
(
this
.
ContextMenuLastInfo
);
this
.
delegate
.
GetContextMenuInfo
(
this
.
ContextMenuLastInfo
);
isSelectCell
=
(
this
.
ContextMenuLastInfo
.
selectCell
!=
null
);
var
_data1
=
null
;
var
_data2
=
null
;
...
...
@@ -1118,7 +1140,6 @@
if
(
_data1
&&
_data2
)
{
isSelectCell
=
true
;
if
(
Math
.
abs
(
_data1
.
X
-
_data2
.
X
)
<
0.1
&&
Math
.
abs
(
_data1
.
Y
-
_data2
.
Y
)
<
0.1
&&
Math
.
abs
(
_data1
.
W
-
_data2
.
W
)
<
0.1
&&
...
...
@@ -1172,7 +1193,7 @@
}
}
if
(
this
.
ContextMenuLastMode
==
oldLasdMode
)
if
(
this
.
ContextMenuLastMode
==
oldLasdMode
&&
isEqual
)
{
this
.
ContextMenuLastModeCounter
++
;
this
.
ContextMenuLastModeCounter
&=
0x01
;
...
...
@@ -1181,14 +1202,87 @@
{
this
.
ContextMenuLastModeCounter
=
0
;
}
switch
(
this
.
ContextMenuLastMode
)
{
case
AscCommon
.
MobileTouchContextMenuType
.
Target
:
{
isShowContextMenu
=
(
1
==
this
.
ContextMenuLastModeCounter
);
break
;
}
case
AscCommon
.
MobileTouchContextMenuType
.
Select
:
{
if
(
isSelectCell
)
isShowContextMenu
=
(
1
==
this
.
ContextMenuLastModeCounter
);
else
isShowContextMenu
=
true
;
break
;
}
case
AscCommon
.
MobileTouchContextMenuType
.
Object
:
{
isShowContextMenu
=
(
0
==
this
.
ContextMenuLastModeCounter
);
break
;
}
case
AscCommon
.
MobileTouchContextMenuType
.
Slide
:
{
isShowContextMenu
=
(
1
==
this
.
ContextMenuLastModeCounter
);
break
;
}
default
:
{
isShowContextMenu
=
(
1
==
this
.
ContextMenuLastModeCounter
);
break
;
}
}
}
else
{
// меню для текстового селекта показываем всегда
isShowContextMenu
=
(
!
isSelectCell
&&
(
this
.
ContextMenuLastMode
==
AscCommon
.
MobileTouchContextMenuType
.
Select
));
if
(
this
.
ContextMenuLastShow
)
{
// эмулируем пропажу меню (клик туда же)
switch
(
this
.
ContextMenuLastMode
)
{
case
AscCommon
.
MobileTouchContextMenuType
.
Target
:
case
AscCommon
.
MobileTouchContextMenuType
.
Select
:
{
this
.
ContextMenuLastModeCounter
=
0
;
break
;
}
case
AscCommon
.
MobileTouchContextMenuType
.
Object
:
{
this
.
ContextMenuLastModeCounter
=
1
;
break
;
}
case
AscCommon
.
MobileTouchContextMenuType
.
Slide
:
{
this
.
ContextMenuLastModeCounter
=
0
;
break
;
}
default
:
{
break
;
}
}
}
}
if
(
this
.
ContextMenuLastMode
>
AscCommon
.
MobileTouchContextMenuType
.
None
&&
1
==
this
.
ContextMenuLastModeCounter
)
if
(
isSelectTouch
)
isShowContextMenu
=
true
;
if
(
isGlassTouch
)
isShowContextMenu
=
true
;
if
(
this
.
ContextMenuLastMode
>
AscCommon
.
MobileTouchContextMenuType
.
None
&&
isShowContextMenu
)
{
this
.
ContextMenuLastShow
=
true
;
this
.
SendShowContextMenu
();
}
else
{
this
.
ContextMenuLastShow
=
false
;
}
};
CMobileTouchManagerBase
.
prototype
.
ClearContextMenu
=
function
()
...
...
slide/Drawing/mobileTouchManager.js
View file @
fb13cf1e
...
...
@@ -157,10 +157,17 @@
var
_target
=
_controller
.
Is_SelectionUse
();
if
(
_target
===
false
)
{
/*
_info = {
X : this.DrawingDocument.m_dTargetX,
Y : this.DrawingDocument.m_dTargetY,
Page : this.DrawingDocument.m_lTargetPage
};
*/
_info
=
{
X
:
this
.
DrawingDocument
.
m_dTarget
X
,
Y
:
this
.
DrawingDocument
.
m_dTarget
Y
,
Page
:
this
.
DrawingDocument
.
m_lTargetPage
X
:
this
.
LogicDocument
.
TargetPos
.
X
,
Y
:
this
.
LogicDocument
.
TargetPos
.
Y
,
Page
:
this
.
LogicDocument
.
TargetPos
.
PageNum
};
_transform
=
this
.
DrawingDocument
.
TextMatrix
;
...
...
@@ -173,6 +180,7 @@
_info
.
Y
=
_y
;
}
info
.
targetPos
=
_info
;
return
;
}
var
_select
=
_controller
.
Get_SelectionBounds
();
...
...
@@ -206,12 +214,13 @@
}
info
.
selectText
=
_info
;
return
;
}
var
_object_bounds
=
_controller
.
getSelectedObjectsBounds
();
if
(
(
0
==
_mode
)
&&
_object_bounds
)
if
(
_object_bounds
)
{
info
.
sel
ectBounds
=
{
info
.
obj
ectBounds
=
{
X
:
_object_bounds
.
minX
,
Y
:
_object_bounds
.
minY
,
R
:
_object_bounds
.
maxX
,
...
...
@@ -737,7 +746,9 @@
}
var
isCheckContextMenuMode
=
true
;
var
isCheckContextMenuSelect
=
false
;
var
isCheckContextMenuCursor
=
(
this
.
Mode
==
AscCommon
.
MobileTouchMode
.
Cursor
);
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
...
...
@@ -930,7 +941,7 @@
AscCommon
.
g_inputContext
.
preventVirtualKeyboard
(
e
);
if
(
true
!==
this
.
iScroll
.
isAnimating
)
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
,
isCheckContextMenuSelect
);
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
,
isCheckContextMenuSelect
,
isCheckContextMenuCursor
);
return
false
;
};
...
...
word/Drawing/mobileTouchManager.js
View file @
fb13cf1e
...
...
@@ -458,7 +458,9 @@
}
var
isCheckContextMenuMode
=
true
;
var
isCheckContextMenuSelect
=
false
;
var
isCheckContextMenuCursor
=
(
this
.
Mode
==
AscCommon
.
MobileTouchMode
.
Cursor
);
var
isPreventDefault
=
false
;
switch
(
this
.
Mode
)
...
...
@@ -651,7 +653,7 @@
AscCommon
.
g_inputContext
.
preventVirtualKeyboard
(
e
);
if
(
true
!==
this
.
iScroll
.
isAnimating
)
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
,
isCheckContextMenuSelect
);
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
,
isCheckContextMenuSelect
,
isCheckContextMenuCursor
);
return
false
;
};
...
...
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