Skip to content

Commit

Permalink
Fix dnnsoftware#5912: Resource Manger Context Menu Doesn't reposition…
Browse files Browse the repository at this point in the history
… after scroll.
  • Loading branch information
zyhfish committed Jan 14, 2024
1 parent 5343fec commit 797eaa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-weight: normal;
color: black;
transition: all 300ms ease-in-out;
position: relative;
}
:host(.selected){
.item-name{
Expand All @@ -22,7 +23,7 @@ button{
cursor: pointer;
}
dnn-collapsible{
position: fixed;
position: absolute;
display: none;
border: 1px solid lightgray;
box-shadow: 2px 2px 4px -2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,17 @@ export class DnnRmFolderListItem {

private handleContextMenu(e: MouseEvent): void {
e.preventDefault();
this.dismissContextMenu();

this.itemsClient.getFolderItem(Number.parseInt(this.folder.data.key))
.then(item => {
const collapsible = document.createElement("dnn-collapsible");
const folderContextMenu = document.createElement("dnn-rm-folder-context-menu");
collapsible.appendChild(folderContextMenu);
folderContextMenu.item = item;
collapsible.style.left = `${e.pageX}px`;
collapsible.style.top = `${e.pageY}px`;
const parentPosition = this.el.getBoundingClientRect();
collapsible.style.left = `${e.clientX - parentPosition.left}px`;
collapsible.style.top = `${e.clientY - parentPosition.top}px`;
collapsible.style.display = "block";
this.el.shadowRoot.appendChild(collapsible);
setTimeout(() => {
Expand Down

0 comments on commit 797eaa0

Please sign in to comment.