Skip to content

Commit 268eeb3

Browse files
committed
UI improvements for the heade
1 parent 429fd5b commit 268eeb3

File tree

3 files changed

+1
-64
lines changed

3 files changed

+1
-64
lines changed

src/bundle/Resources/public/js/scripts/edit.header.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(function (global, doc, ibexa) {
22
const SCROLL_POSITION_TO_FIT = 50;
3-
const HEADER_RIGHT_MARGIN = 50;
43
const MIN_HEIGHT_DIFF_FOR_FITTING_HEADER = 150;
54
const headerNode = doc.querySelector('.ibexa-edit-header');
65
const contentNode = doc.querySelector('.ibexa-edit-content');
@@ -13,20 +12,6 @@
1312
const { height: expandedHeaderHeight } = headerNode.getBoundingClientRect();
1413
const scrolledContent = doc.querySelector('.ibexa-edit-content > :first-child');
1514
const { controlZIndex } = ibexa.helpers.modal;
16-
const fitEllipsizedTitle = () => {
17-
const titleNode = headerBottomRowNode.querySelector('.ibexa-edit-header__name--ellipsized');
18-
const firstMenuEntryNode = headerNode.querySelector('.ibexa-context-menu .ibexa-context-menu__item');
19-
const { left: titleNodeLeft, width: titleNodeWidth } = titleNode.getBoundingClientRect();
20-
const { left: firstMenuEntryNodeLeft } = firstMenuEntryNode.getBoundingClientRect();
21-
const bottomRowNodeWidthNew = firstMenuEntryNodeLeft - titleNodeLeft;
22-
const titleNodeWidthNew = bottomRowNodeWidthNew - HEADER_RIGHT_MARGIN;
23-
24-
headerBottomRowNode.style.width = `${bottomRowNodeWidthNew}px`;
25-
26-
if (titleNodeWidth > titleNodeWidthNew) {
27-
titleNode.style.width = `${titleNodeWidthNew}px`;
28-
}
29-
};
3015
const fitHeader = (event) => {
3116
const { height: formHeight } = scrolledContent.getBoundingClientRect();
3217
const contentHeightWithExpandedHeader = formHeight + expandedHeaderHeight;
@@ -40,12 +25,6 @@
4025
const shouldHeaderBeSlim = scrollTop > SCROLL_POSITION_TO_FIT;
4126

4227
headerNode.classList.toggle('ibexa-edit-header--slim', shouldHeaderBeSlim);
43-
44-
if (shouldHeaderBeSlim) {
45-
fitEllipsizedTitle();
46-
} else {
47-
headerBottomRowNode.style.width = '100%';
48-
}
4928
};
5029

5130
contentNode.addEventListener('scroll', fitHeader, false);

src/bundle/Resources/public/scss/_edit-header.scss

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,7 @@
2525
}
2626

2727
&__name {
28-
&--ellipsized {
29-
display: none;
30-
}
31-
32-
&--full {
33-
display: -webkit-box;
34-
-webkit-line-clamp: 2;
35-
-webkit-box-orient: vertical;
36-
white-space: normal;
37-
max-width: 100%;
38-
overflow: hidden;
39-
text-overflow: ellipsis;
40-
}
28+
max-width: calc(100vw - calculateRem(130px));
4129
}
4230

4331
&__row {
@@ -153,23 +141,10 @@
153141
}
154142

155143
.ibexa-edit-header {
156-
&__row {
157-
&--bottom {
158-
z-index: 1;
159-
min-width: initial;
160-
margin-top: calculateRem(-34px);
161-
min-height: initial;
162-
}
163-
}
164-
165144
&__bottom-row-line {
166145
border-bottom: none;
167146
}
168147

169-
&__info-bar {
170-
margin-top: calculateRem(-8px);
171-
}
172-
173148
&__separate-div {
174149
transform: scaleX(1);
175150
}
@@ -187,16 +162,6 @@
187162
&__meta {
188163
display: none;
189164
}
190-
191-
&__name {
192-
&--ellipsized {
193-
display: inline-block;
194-
}
195-
196-
&--full {
197-
display: none;
198-
}
199-
}
200165
}
201166
}
202167
}

src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,12 @@
4242
name: title,
4343
}) }}
4444
</span>
45-
<span class="ibexa-edit-header__name ibexa-edit-header__name--full">
46-
{{ title }}
47-
</span>
4845
{% block after_title %}{% endblock %}
4946
</h1>
5047

5148
{% if subtitle is defined %}
5249
<div class="ibexa-edit-header__subtitle">{{ subtitle }}</div>
5350
{% endif %}
54-
55-
{# {{ dump(ibexa_admin_ui_config.userContentTypes) }}
56-
{{ dump(content_type.identifier) }}
57-
{% set checkIsMetaVisible = (content is defined and content is not null) %} #}
5851

5952
{% if content is defined and content is not null %}
6053
<div class="ibexa-edit-header__meta">

0 commit comments

Comments
 (0)