Skip to content

Commit

Permalink
EZP-31632: Added "edit header" offset
Browse files Browse the repository at this point in the history
  • Loading branch information
SerheyDolgushev committed Oct 6, 2020
1 parent 2e6acfe commit 16d73b0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export default class EzConfigFixedBase extends EzConfigBase {
const editorRect = editor.element.getClientRect();
const toolbarHeight = toolbar ? toolbar.getBoundingClientRect().height : 0;
const shouldBeFixed = editorRect.top - toolbarHeight - 2 * TOOLBAR_OFFSET < 0;
const header = document.querySelector('.ez-edit-header__content-type-name');
const top = shouldBeFixed
? TOOLBAR_OFFSET
? TOOLBAR_OFFSET + (header ? header.offsetHeight : 0)
: editorRect.top + editor.element.getWindow().getScrollPosition().y - toolbarHeight - TOOLBAR_OFFSET;

if (toolbar) {
Expand Down

0 comments on commit 16d73b0

Please sign in to comment.