Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
3653a38d
Unverified
Commit
3653a38d
authored
Apr 14, 2020
by
yann300
Committed by
GitHub
Apr 14, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2718 from ethereum/rename-menu
Fixed wrong position of rename menu
parents
840a0004
bc6082ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
contextMenu.js
src/app/ui/contextMenu.js
+12
-2
No files found.
src/app/ui/contextMenu.js
View file @
3653a38d
...
@@ -45,12 +45,22 @@ module.exports = (event, items) => {
...
@@ -45,12 +45,22 @@ module.exports = (event, items) => {
current
.
onclick
=
()
=>
{
hide
(
null
,
true
);
items
[
item
]()
}
current
.
onclick
=
()
=>
{
hide
(
null
,
true
);
items
[
item
]()
}
return
current
return
current
})
})
const
container
=
yo
`<div class="p-1
${
css
.
container
}
bg-light shadow border"><ul id='menuitems'>
${
menu
}
</ul></div>`
const
container
=
yo
`<div id="menuItemsContainer" class="p-1
${
css
.
container
}
bg-light shadow border"><ul id='menuitems'>
${
menu
}
</ul></div>`
container
.
style
.
left
=
event
.
pageX
+
'px'
container
.
style
.
left
=
event
.
pageX
+
'px'
container
.
style
.
top
=
event
.
pageY
+
'px'
container
.
style
.
top
=
event
.
pageY
+
'px'
container
.
style
.
display
=
'block'
container
.
style
.
display
=
'block'
document
.
querySelector
(
'body'
).
appendChild
(
container
)
document
.
querySelector
(
'body'
).
appendChild
(
container
)
const
menuItemsContainer
=
document
.
getElementById
(
'menuItemsContainer'
)
const
boundary
=
menuItemsContainer
.
getBoundingClientRect
()
if
(
boundary
.
bottom
>
(
window
.
innerHeight
||
document
.
documentElement
.
clientHeight
))
{
menuItemsContainer
.
style
.
position
=
'absolute'
menuItemsContainer
.
style
.
bottom
=
'10px'
menuItemsContainer
.
style
.
top
=
null
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
window
.
addEventListener
(
'click'
,
hide
)
window
.
addEventListener
(
'click'
,
hide
)
},
500
)
},
500
)
...
...
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