Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
CIM
Pintura
Commits
de0c64bb
Commit
de0c64bb
authored
Aug 30, 2018
by
Richard Marston
Browse files
Fix context menu
parent
6c68bd02
Pipeline
#71319
passed with stages
in 7 minutes and 34 seconds
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
generateIndex.js
View file @
de0c64bb
...
...
@@ -230,7 +230,7 @@ var contextmenu = new tag('nav').
c
(
new
tag
(
'
li
'
).
a
(
'
class
'
,
'
"context-menu-item"
'
).
c
(
new
tag
(
'
a
'
).
a
(
'
class
'
).
a
(
'
onclick
'
,
'
"c
imc
ontext
m
enu.removeComponent()"
'
).
a
(
'
class
'
).
a
(
'
onclick
'
,
'
"c
urrentCimsvg().getC
ontext
M
enu
()
.removeComponent()"
'
).
t
(
"
Delete Component
"
))))
var
main
=
new
tag
(
'
div
'
).
a
(
'
id
'
,
'
"main"
'
).
c
(
diagram
).
c
(
floating_menu
).
c
(
contextmenu
)
...
...
index.js
View file @
de0c64bb
...
...
@@ -27,6 +27,7 @@ cimsvg.setCimsvg(cimsvgInstance);
let
contextMenu
=
new
contextmenu
(
document
.
getElementById
(
"
context-menu
"
),
"
context-menu
"
)
contextMenu
.
resizeListener
(
window
);
contextMenu
.
keyUpListener
(
window
);
cimsvgInstance
.
setContextMenu
(
contextMenu
);
document
.
oncontextmenu
=
function
(
e
){
if
(
e
.
preventDefault
!=
undefined
)
{
...
...
src/cimsvg.js
View file @
de0c64bb
...
...
@@ -46,8 +46,17 @@ class cimsvg {
this
.
rdfFileCount
=
0
;
this
.
rdfFileReceived
=
0
;
this
.
jsonBaseData
=
null
;
this
.
contextMenu
=
null
;
}
setContextMenu
(
menu
)
{
this
.
contextMenu
=
menu
;
};
getContextMenu
()
{
return
this
.
contextMenu
;
};
/*
* How many pieces the data will be arriving in
*/
...
...
src/contextmenu.js
View file @
de0c64bb
...
...
@@ -19,12 +19,10 @@
class
contextmenu
{
constructor
(
menu
,
label
)
{
console
.
log
(
menu
,
label
);
this
.
menuList
=
{
[
label
]:
menu
};
this
.
menuState
=
{};
this
.
id
;
this
.
type
;
console
.
log
(
this
.
menuList
);
}
keyUpListener
(
_window
)
{
...
...
@@ -70,7 +68,6 @@ class contextmenu {
* Positions the menu.
*/
positionMenu
(
pos
,
menuName
)
{
console
.
log
(
menuName
)
this
.
menuList
[
menuName
].
style
.
left
=
pos
.
x
+
"
px
"
;
this
.
menuList
[
menuName
].
style
.
top
=
pos
.
y
+
"
px
"
;
}
...
...
Write
Preview
Supports
Markdown
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