diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-16 16:03:11 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-21 11:29:58 +0100 |
commit | 845f0bd401078e0450f170ff9c379da3bcba55a9 (patch) | |
tree | cf27468b6243a2c9bd9eda6bcebd8cccb8f72c47 /settings/js/federationscopemenu.js | |
parent | a15809ceed0125cf9a5dbc94d09d56816bcdd32c (diff) | |
download | nextcloud-server-845f0bd401078e0450f170ff9c379da3bcba55a9.tar.gz nextcloud-server-845f0bd401078e0450f170ff9c379da3bcba55a9.zip |
Fix position of menu
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'settings/js/federationscopemenu.js')
-rw-r--r-- | settings/js/federationscopemenu.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/settings/js/federationscopemenu.js b/settings/js/federationscopemenu.js index 45937911f09..e129f69fe9e 100644 --- a/settings/js/federationscopemenu.js +++ b/settings/js/federationscopemenu.js @@ -109,10 +109,24 @@ show: function(context) { this._context = context; + var $el = $(context.target); + var offsetIcon = $el.offset(); + var offsetHeading = $el.closest('h2').offset(); + this.render(); this.$el.removeClass('hidden'); OC.showMenu(null, this.$el); + + //Set the menuwidth + var menuWidth = this.$el.width(); + this.$el.css('width', menuWidth); + + //Calculate menu position + var l = offsetIcon.left - offsetHeading.left; + l = l - (menuWidth / 2) + ($el.width()/2); + this.$el.css('left', l); + } }); |