Skip to content

Commit

Permalink
fixes after cr
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM committed Nov 23, 2022
1 parent c873b60 commit a329538
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
parseAll(entry.target);
});
});
const parseAll = (baseElement = doc) => {
const parse = (baseElement = doc) => {
if (!baseElement) {
console.warn('No baseElement provided');

return;
}

const middleEllipsisContainers = [...doc.querySelectorAll('.ibexa-middle-ellipsis')];
const middleEllipsisContainers = [...baseElement.querySelectorAll('.ibexa-middle-ellipsis')];

if (baseElement instanceof Element) {
middleEllipsisContainers.push(baseElement);
Expand All @@ -24,12 +26,15 @@
resizeEllipsisObserver.observe(middleEllipsisContainer);
});
};
// @deprecated, will be removed in 5.0
const parseAll = () => parse(doc);
const update = (baseElement, content) => {
const contentElements = [...baseElement.querySelectorAll('.ibexa-middle-ellipsis__name-ellipsized')];
const contentEscaped = ibexa.helpers.text.escapeHTML(content);

baseElement.dataset.bsOriginalTitle = content;
baseElement.dataset.bsOriginalTitle = contentEscaped;
contentElements.forEach((contentElement) => {
contentElement.innerHTML = content;
contentElement.innerHTML = contentEscaped;
});
parseAll(baseElement);
};
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/views/themes/admin/ui/tag.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% set is_deletable = is_deletable is defined ? is_deletable : true %}
{% set tag_attributes = tag_attributes|default({})|merge({
'class': (tag_attributes.class|default('') ~ ' ibexa-tag' ~ (is_deletable ? ' ibexa-tag--deletable'))|trim
class: (tag_attributes.class|default('') ~ ' ibexa-tag' ~ (is_deletable ? ' ibexa-tag--deletable'))|trim
}) %}

<div {{ html.attributes(tag_attributes) }}>
Expand Down

0 comments on commit a329538

Please sign in to comment.