Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Removes unnecessary width/height
Browse files Browse the repository at this point in the history
Resolves #7403 #7662

Auditors: @bsclifton

Test Plan:
- specified in the issue #7403
  • Loading branch information
NejcZdovc committed Mar 12, 2017
1 parent 3ad0f41 commit 7d1791c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions js/components/contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ContextMenuItem extends ImmutableComponent {
const parentBoundingRect = parentNode.getBoundingClientRect()
const boundingRect = node.getBoundingClientRect()
openedSubmenuDetails = openedSubmenuDetails.push(Immutable.fromJS({
y: boundingRect.top - parentBoundingRect.top - 1,
y: boundingRect.top - parentBoundingRect.top - 1 + parentNode.scrollTop,
template: this.submenu
}))
}
Expand Down Expand Up @@ -218,7 +218,7 @@ class ContextMenuSingle extends ImmutableComponent {
render () {
const styles = {}
if (this.props.y) {
styles.top = this.props.y
styles.marginTop = this.props.y
}
const visibleMenuItems = this.props.template.filter((element) => {
return element.has('visible')
Expand Down Expand Up @@ -443,7 +443,7 @@ class ContextMenu extends ImmutableComponent {
styles.right = this.props.contextMenuDetail.get('right')
}
if (this.props.contextMenuDetail.get('top') !== undefined) {
styles.top = this.props.contextMenuDetail.get('top')
styles.marginTop = this.props.contextMenuDetail.get('top')
}
if (this.props.contextMenuDetail.get('bottom') !== undefined) {
styles.bottom = this.props.contextMenuDetail.get('bottom')
Expand Down
7 changes: 5 additions & 2 deletions less/contextMenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@
}
// This is a reasonable max height and also solves problems for bookmarks menu
// and bookmarks overflow menu reaching down too low.
height: 100%;
width: 100%;
min-width: 225px;
@usedUpChrome: @navbarHeight + @bookmarksToolbarWithFaviconsHeight;
max-height: calc(~'100% - @{usedUpChrome}');
overflow: auto;
position: absolute;
z-index: @zindexContextMenu;
padding-right: 10px;
padding-bottom: 10px;
-webkit-user-select: none;
&.reverseExpand {
flex-direction: row-reverse;
padding-right: 0;
padding-left: 10px;
}

.contextMenuSingle {
Expand Down

0 comments on commit 7d1791c

Please sign in to comment.