1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/components/gh-contentfilter.js

22 lines
705 B
JavaScript
Raw Normal View History

import Component from '@glimmer/component';
import {inject as service} from '@ember/service';
export default class GhContentfilterComponent extends Component {
@service customViews;
@service router;
@service session;
calculateActionsDropdownPosition(trigger, content) {
let {top, left, width, height} = trigger.getBoundingClientRect();
// content.firstElementChild is required because we use .dropdown-menu which is absolute positioned
let {width: contentWidth} = content.firstElementChild.getBoundingClientRect();
let style = {
left: left + width - contentWidth,
top: top + height + 5
};
return {style};
}
}