2021-01-28 18:25:21 +03:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import calculatePosition from 'ember-basic-dropdown/utils/calculate-position';
|
2022-02-01 12:34:03 +03:00
|
|
|
import classic from 'ember-classic-decorator';
|
2021-01-28 18:25:21 +03:00
|
|
|
import {and, match} from '@ember/object/computed';
|
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
@classic
|
|
|
|
export default class Footer extends Component {
|
2022-02-01 20:03:45 +03:00
|
|
|
@service config;
|
|
|
|
@service session;
|
|
|
|
@service router;
|
|
|
|
@service whatsNew;
|
|
|
|
@service feature;
|
2022-02-01 12:34:03 +03:00
|
|
|
|
|
|
|
@and('config.clientExtensions.dropdown', 'session.user.isOwnerOnly')
|
|
|
|
showDropdownExtension;
|
|
|
|
|
|
|
|
@match('router.currentRouteName', /^settings/)
|
|
|
|
isSettingsRoute;
|
2021-01-28 18:25:21 +03:00
|
|
|
|
|
|
|
// 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};
|
|
|
|
}
|
2022-02-01 12:34:03 +03:00
|
|
|
}
|