From 7d1791cb0970979ae1b6336a8b02bb19db170fcc Mon Sep 17 00:00:00 2001 From: NejcZdovc Date: Sun, 12 Mar 2017 11:56:44 +0100 Subject: [PATCH] Removes unnecessary width/height Resolves #7403 #7662 Auditors: @bsclifton Test Plan: - specified in the issue #7403 --- js/components/contextMenu.js | 6 +++--- less/contextMenu.less | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/components/contextMenu.js b/js/components/contextMenu.js index cb14b711681..5ed53ca63ee 100644 --- a/js/components/contextMenu.js +++ b/js/components/contextMenu.js @@ -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 })) } @@ -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') @@ -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') diff --git a/less/contextMenu.less b/less/contextMenu.less index 6da9dc8f09e..47e69dd01f2 100644 --- a/less/contextMenu.less +++ b/less/contextMenu.less @@ -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 {