Skip to content

Commit

Permalink
Merge pull request #3096 from tvdeyen/element-hint-in-header-again
Browse files Browse the repository at this point in the history
Move element hint into header (again)
  • Loading branch information
tvdeyen authored Nov 28, 2024
2 parents 0b6402e + b3e8fb3 commit e6523b8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css.map

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions app/stylesheets/alchemy/admin/elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,17 @@ alchemy-tinymce {
}

.element-title {
display: inline-flex;
align-items: center;
flex-grow: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
transition: color vars.$transition-duration;
line-height: 1;
max-width: 85%;

.element-hidden > & {
max-width: 65%;
}

.preview_text_quote {
overflow: hidden;
text-overflow: ellipsis;
font-size: var(--font-size_small);
margin-left: var(--spacing-0);
}
Expand All @@ -99,6 +97,7 @@ alchemy-tinymce {
font-size: var(--font-size_small);
font-weight: bold;
line-height: 15px;
margin-right: var(--spacing-0);
}

.element-handle {
Expand Down Expand Up @@ -160,6 +159,14 @@ alchemy-tinymce {
> .element-header {
background-color: transparent;

.element-title {
max-width: 65%;
}

.element-toggle {
margin-left: var(--spacing-1);
}

.element-hidden-icon {
display: inline-flex;
align-items: center;
Expand Down
4 changes: 0 additions & 4 deletions app/views/alchemy/admin/elements/_element.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

<%= render 'alchemy/admin/elements/toolbar', element: element %>

<% if element.has_hint? %>
<%= render_message(:hint, sanitize(element.hint)) %>
<% end %>

<% element.definition[:message].tap do |message| %>
<%= render_message(:info, sanitize(message)) if message %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions app/views/alchemy/admin/elements/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</span>
<span class="element-title">
<span class="preview_text_element_name"><%= element.display_name %></span>
<%= render_hint_for(element, size: "1x", fixed_width: false) %>
<span class="preview_text_quote">
<%= sanitize(element.preview_text.presence || '&nbsp;') %>
</span>
Expand Down

0 comments on commit e6523b8

Please sign in to comment.