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
b86badaf
Commit
b86badaf
authored
Jan 25, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile: use contextmenu last info
parent
17b766b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
276 additions
and
0 deletions
+276
-0
cell/view/mobileTouch.js
cell/view/mobileTouch.js
+87
-0
common/Scrolls/mobileTouchManagerBase.js
common/Scrolls/mobileTouchManagerBase.js
+103
-0
slide/Drawing/mobileTouchManager.js
slide/Drawing/mobileTouchManager.js
+86
-0
No files found.
cell/view/mobileTouch.js
View file @
b86badaf
...
@@ -181,6 +181,93 @@ function (window, undefined)
...
@@ -181,6 +181,93 @@ function (window, undefined)
return
_mode
;
return
_mode
;
};
};
CMobileDelegateEditorCell
.
prototype
.
GetContextMenuInfo
=
function
(
info
)
{
info
.
Clear
();
var
_info
=
null
;
var
_transform
=
null
;
var
_x
=
0
;
var
_y
=
0
;
var
_controller
=
this
.
WB
.
getWorksheet
().
objectRender
.
controller
;
var
_target
=
_controller
.
Is_SelectionUse
();
var
_selection
=
this
.
WB
.
GetSelectionRectsBounds
();
if
(
!
_target
&&
!
_selection
)
{
_info
=
{
X
:
this
.
DrawingDocument
.
m_dTargetX
,
Y
:
this
.
DrawingDocument
.
m_dTargetY
,
Page
:
this
.
DrawingDocument
.
m_lTargetPage
};
_transform
=
this
.
DrawingDocument
.
TextMatrix
;
if
(
_transform
)
{
_x
=
_transform
.
TransformPointX
(
_info
.
X
,
_info
.
Y
);
_y
=
_transform
.
TransformPointY
(
_info
.
X
,
_info
.
Y
);
_info
.
X
=
_x
;
_info
.
Y
=
_y
;
}
info
.
targetPos
=
_info
;
}
var
_select
=
_controller
.
Get_SelectionBounds
();
if
(
_select
)
{
var
_rect1
=
_select
.
Start
;
var
_rect2
=
_select
.
End
;
_info
=
{
X1
:
_rect1
.
X
,
Y1
:
_rect1
.
Y
,
Page1
:
_rect1
.
Page
,
X2
:
_rect2
.
X
+
_rect2
.
W
,
Y2
:
_rect2
.
Y
+
_rect2
.
H
,
Page2
:
_rect2
.
Page
};
_transform
=
this
.
DrawingDocument
.
SelectionMatrix
;
if
(
_transform
)
{
_x
=
_transform
.
TransformPointX
(
_info
.
X1
,
_info
.
Y1
);
_y
=
_transform
.
TransformPointY
(
_info
.
X1
,
_info
.
Y1
);
_info
.
X1
=
_x
;
_info
.
Y1
=
_y
;
_x
=
_transform
.
TransformPointX
(
_info
.
X2
,
_info
.
Y2
);
_y
=
_transform
.
TransformPointY
(
_info
.
X2
,
_info
.
Y2
);
_info
.
X2
=
_x
;
_info
.
Y2
=
_y
;
}
info
.
selectText
=
_info
;
}
else
if
(
_selection
)
{
info
.
selectCell
=
{
X
:
_selection
.
X
,
Y
:
_selection
.
Y
,
W
:
_selection
.
W
,
H
:
_selection
.
H
};
}
var
_object_bounds
=
_controller
.
getSelectedObjectsBounds
();
if
((
0
==
_mode
)
&&
_object_bounds
)
{
info
.
selectBounds
=
{
X
:
_object_bounds
.
minX
,
Y
:
_object_bounds
.
minY
,
R
:
_object_bounds
.
maxX
,
B
:
_object_bounds
.
maxY
,
Page
:
_object_bounds
.
pageIndex
};
}
};
CMobileDelegateEditorCell
.
prototype
.
GetContextMenuPosition
=
function
()
CMobileDelegateEditorCell
.
prototype
.
GetContextMenuPosition
=
function
()
{
{
var
_controller
=
this
.
WB
.
getWorksheet
().
objectRender
.
controller
;
var
_controller
=
this
.
WB
.
getWorksheet
().
objectRender
.
controller
;
...
...
common/Scrolls/mobileTouchManagerBase.js
View file @
b86badaf
...
@@ -60,6 +60,28 @@
...
@@ -60,6 +60,28 @@
Slide
:
4
Slide
:
4
};
};
function
MobileTouchContextMenuLastInfo
()
{
this
.
targetPos
=
null
;
this
.
selectText
=
null
;
this
.
selectCell
=
null
;
this
.
objectBounds
=
null
;
this
.
objectSlideThumbnail
=
null
;
}
MobileTouchContextMenuLastInfo
.
prototype
=
{
Clear
:
function
()
{
this
.
targetPos
=
null
;
this
.
selectText
=
null
;
this
.
selectCell
=
null
;
this
.
objectBounds
=
null
;
this
.
objectSlideThumbnail
=
null
;
}
};
AscCommon
.
MobileTouchContextMenuLastInfo
=
MobileTouchContextMenuLastInfo
;
AscCommon
.
MOBILE_SELECT_TRACK_ROUND
=
14
;
AscCommon
.
MOBILE_SELECT_TRACK_ROUND
=
14
;
AscCommon
.
MOBILE_TABLE_RULER_DIAMOND
=
7
;
AscCommon
.
MOBILE_TABLE_RULER_DIAMOND
=
7
;
...
@@ -134,6 +156,10 @@
...
@@ -134,6 +156,10 @@
{
{
return
AscCommon
.
MobileTouchContextMenuType
.
None
;
return
AscCommon
.
MobileTouchContextMenuType
.
None
;
};
};
CMobileDelegateSimple
.
prototype
.
GetContextMenuInfo
=
function
(
info
)
{
info
.
Clear
();
};
CMobileDelegateEditor
.
prototype
.
GetContextMenuPosition
=
function
()
CMobileDelegateEditor
.
prototype
.
GetContextMenuPosition
=
function
()
{
{
return
null
;
return
null
;
...
@@ -240,6 +266,81 @@
...
@@ -240,6 +266,81 @@
return
_mode
;
return
_mode
;
};
};
CMobileDelegateEditor
.
prototype
.
GetContextMenuInfo
=
function
(
info
)
{
info
.
Clear
();
var
_info
=
null
;
var
_transform
=
null
;
var
_x
=
0
;
var
_y
=
0
;
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
};
_transform
=
this
.
DrawingDocument
.
TextMatrix
;
if
(
_transform
)
{
_x
=
_transform
.
TransformPointX
(
_info
.
X
,
_info
.
Y
);
_y
=
_transform
.
TransformPointY
(
_info
.
X
,
_info
.
Y
);
_info
.
X
=
_x
;
_info
.
Y
=
_y
;
}
info
.
targetPos
=
_info
;
}
var
_select
=
this
.
LogicDocument
.
Get_SelectionBounds
();
if
(
_select
)
{
var
_rect1
=
_select
.
Start
;
var
_rect2
=
_select
.
End
;
_info
=
{
X1
:
_rect1
.
X
,
Y1
:
_rect1
.
Y
,
Page1
:
_rect1
.
Page
,
X2
:
_rect2
.
X
+
_rect2
.
W
,
Y2
:
_rect2
.
Y
+
_rect2
.
H
,
Page2
:
_rect2
.
Page
};
_transform
=
this
.
DrawingDocument
.
SelectionMatrix
;
if
(
_transform
)
{
_x
=
_transform
.
TransformPointX
(
_info
.
X1
,
_info
.
Y1
);
_y
=
_transform
.
TransformPointY
(
_info
.
X1
,
_info
.
Y1
);
_info
.
X1
=
_x
;
_info
.
Y1
=
_y
;
_x
=
_transform
.
TransformPointX
(
_info
.
X2
,
_info
.
Y2
);
_y
=
_transform
.
TransformPointY
(
_info
.
X2
,
_info
.
Y2
);
_info
.
X2
=
_x
;
_info
.
Y2
=
_y
;
}
info
.
selectText
=
_info
;
}
var
_object_bounds
=
this
.
LogicDocument
.
DrawingObjects
.
getSelectedObjectsBounds
();
if
((
0
==
_mode
)
&&
_object_bounds
)
{
info
.
selectBounds
=
{
X
:
_object_bounds
.
minX
,
Y
:
_object_bounds
.
minY
,
R
:
_object_bounds
.
maxX
,
B
:
_object_bounds
.
maxY
,
Page
:
_object_bounds
.
pageIndex
};
}
};
CMobileDelegateEditor
.
prototype
.
GetContextMenuPosition
=
function
()
CMobileDelegateEditor
.
prototype
.
GetContextMenuPosition
=
function
()
{
{
var
_posX
=
0
;
var
_posX
=
0
;
...
@@ -477,6 +578,8 @@
...
@@ -477,6 +578,8 @@
/* context menu */
/* context menu */
this
.
ContextMenuLastMode
=
AscCommon
.
MobileTouchContextMenuType
.
None
;
this
.
ContextMenuLastMode
=
AscCommon
.
MobileTouchContextMenuType
.
None
;
this
.
ContextMenuLastInfo
=
new
AscCommon
.
MobileTouchContextMenuLastInfo
();
this
.
ContextMenuLastModeCounter
=
0
;
this
.
ContextMenuLastModeCounter
=
0
;
this
.
ContextMenuShowTimerId
=
-
1
;
this
.
ContextMenuShowTimerId
=
-
1
;
...
...
slide/Drawing/mobileTouchManager.js
View file @
b86badaf
...
@@ -143,6 +143,83 @@
...
@@ -143,6 +143,83 @@
return
_mode
;
return
_mode
;
};
};
CMobileDelegateEditorPresentation
.
prototype
.
GetContextMenuInfo
=
function
(
info
)
{
info
.
Clear
();
var
_info
=
null
;
var
_transform
=
null
;
var
_x
=
0
;
var
_y
=
0
;
var
_controller
=
this
.
LogicDocument
.
Slides
[
this
.
LogicDocument
.
CurPage
].
graphicObjects
;
var
_target
=
_controller
.
Is_SelectionUse
();
if
(
_target
===
false
)
{
_info
=
{
X
:
this
.
DrawingDocument
.
m_dTargetX
,
Y
:
this
.
DrawingDocument
.
m_dTargetY
,
Page
:
this
.
DrawingDocument
.
m_lTargetPage
};
_transform
=
this
.
DrawingDocument
.
TextMatrix
;
if
(
_transform
)
{
_x
=
_transform
.
TransformPointX
(
_info
.
X
,
_info
.
Y
);
_y
=
_transform
.
TransformPointY
(
_info
.
X
,
_info
.
Y
);
_info
.
X
=
_x
;
_info
.
Y
=
_y
;
}
info
.
targetPos
=
_info
;
}
var
_select
=
_controller
.
Get_SelectionBounds
();
if
(
_select
)
{
var
_rect1
=
_select
.
Start
;
var
_rect2
=
_select
.
End
;
_info
=
{
X1
:
_rect1
.
X
,
Y1
:
_rect1
.
Y
,
Page1
:
_rect1
.
Page
,
X2
:
_rect2
.
X
+
_rect2
.
W
,
Y2
:
_rect2
.
Y
+
_rect2
.
H
,
Page2
:
_rect2
.
Page
};
_transform
=
this
.
DrawingDocument
.
SelectionMatrix
;
if
(
_transform
)
{
_x
=
_transform
.
TransformPointX
(
_info
.
X1
,
_info
.
Y1
);
_y
=
_transform
.
TransformPointY
(
_info
.
X1
,
_info
.
Y1
);
_info
.
X1
=
_x
;
_info
.
Y1
=
_y
;
_x
=
_transform
.
TransformPointX
(
_info
.
X2
,
_info
.
Y2
);
_y
=
_transform
.
TransformPointY
(
_info
.
X2
,
_info
.
Y2
);
_info
.
X2
=
_x
;
_info
.
Y2
=
_y
;
}
info
.
selectText
=
_info
;
}
var
_object_bounds
=
_controller
.
getSelectedObjectsBounds
();
if
((
0
==
_mode
)
&&
_object_bounds
)
{
info
.
selectBounds
=
{
X
:
_object_bounds
.
minX
,
Y
:
_object_bounds
.
minY
,
R
:
_object_bounds
.
maxX
,
B
:
_object_bounds
.
maxY
,
Page
:
_object_bounds
.
pageIndex
};
}
};
CMobileDelegateEditorPresentation
.
prototype
.
GetContextMenuPosition
=
function
()
CMobileDelegateEditorPresentation
.
prototype
.
GetContextMenuPosition
=
function
()
{
{
var
_controller
=
this
.
LogicDocument
.
Slides
[
this
.
LogicDocument
.
CurPage
].
graphicObjects
;
var
_controller
=
this
.
LogicDocument
.
Slides
[
this
.
LogicDocument
.
CurPage
].
graphicObjects
;
...
@@ -987,6 +1064,15 @@
...
@@ -987,6 +1064,15 @@
{
{
return
AscCommon
.
MobileTouchContextMenuType
.
Slide
;
return
AscCommon
.
MobileTouchContextMenuType
.
Slide
;
};
};
CMobileDelegateThumbnails
.
prototype
.
GetContextMenuInfo
=
function
(
info
)
{
info
.
Clear
();
var
aSelected
=
this
.
Thumbnails
.
GetSelectedArray
();
var
nSlideIndex
=
Math
.
min
.
apply
(
Math
,
aSelected
);
info
.
objectSlideThumbnail
=
{
Slide
:
nSlideIndex
};
};
CMobileDelegateThumbnails
.
prototype
.
GetContextMenuPosition
=
function
()
CMobileDelegateThumbnails
.
prototype
.
GetContextMenuPosition
=
function
()
{
{
var
aSelected
=
this
.
Thumbnails
.
GetSelectedArray
();
var
aSelected
=
this
.
Thumbnails
.
GetSelectedArray
();
...
...
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