mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
d51f2bcf23
closes https://github.com/TryGhost/Admin/pull/2107 - updated related babel dependencies - bumped eslint - ran `yarn lint:js --fix` - added eslint ignore comments for some required non-camel-case properties
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
import Component from '@ember/component';
|
|
import calculatePosition from 'ember-basic-dropdown/utils/calculate-position';
|
|
import classic from 'ember-classic-decorator';
|
|
import {and, match} from '@ember/object/computed';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
@classic
|
|
export default class Footer extends Component {
|
|
@service config;
|
|
@service session;
|
|
@service router;
|
|
@service whatsNew;
|
|
@service feature;
|
|
|
|
@and('config.clientExtensions.dropdown', 'session.user.isOwnerOnly')
|
|
showDropdownExtension;
|
|
|
|
@match('router.currentRouteName', /^settings/)
|
|
isSettingsRoute;
|
|
|
|
// equivalent to "left: auto; right: -20px"
|
|
userDropdownPosition(trigger, dropdown) {
|
|
let {horizontalPosition, verticalPosition, style} = calculatePosition(...arguments);
|
|
let {width: dropdownWidth} = dropdown.firstElementChild.getBoundingClientRect();
|
|
|
|
style.right += (dropdownWidth - 20);
|
|
style['z-index'] = '1100';
|
|
|
|
return {horizontalPosition, verticalPosition, style};
|
|
}
|
|
}
|