mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 11:01:20 +01:00
refactor: add icons to selected/all
fix truncation on category select in composer header
This commit is contained in:
@@ -88,12 +88,14 @@ define('forum/unread', [
|
|||||||
{
|
{
|
||||||
cid: 'selected',
|
cid: 'selected',
|
||||||
name: '[[unread:selected]]',
|
name: '[[unread:selected]]',
|
||||||
icon: '',
|
icon: 'fa-regular fa-square-check',
|
||||||
|
color: 'var(--bs-secondary)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cid: 'all',
|
cid: 'all',
|
||||||
name: '[[unread:all]]',
|
name: '[[unread:all]]',
|
||||||
icon: '',
|
icon: 'fa-list',
|
||||||
|
color: 'var(--bs-secondary)',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
defaultCategories,
|
defaultCategories,
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ define('categoryFilter', ['categorySearch', 'api', 'hooks'], function (categoryS
|
|||||||
return a - b;
|
return a - b;
|
||||||
});
|
});
|
||||||
icon.toggleClass('invisible');
|
icon.toggleClass('invisible');
|
||||||
listEl.find('[data-cid="all"] i').toggleClass('invisible', !!selectedCids.length);
|
listEl.find('[data-cid="all"] [component="category/select/icon"]').toggleClass('invisible', !!selectedCids.length);
|
||||||
} else {
|
} else {
|
||||||
el.find('[component="category/select/icon"]').addClass('invisible');
|
el.find('[component="category/select/icon"]').addClass('invisible');
|
||||||
listEl.find('[data-cid="all"] i').removeClass('invisible');
|
listEl.find('[data-cid="all"] [component="category/select/icon"]').removeClass('invisible');
|
||||||
selectedCids = [];
|
selectedCids = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,10 @@
|
|||||||
{{{ if !hideAll }}}
|
{{{ if !hideAll }}}
|
||||||
<li role="presentation" class="category" data-cid="all">
|
<li role="presentation" class="category" data-cid="all">
|
||||||
<a class="dropdown-item rounded-1 d-flex align-items-center gap-2" role="menuitem" href="{{{ if allCategoriesUrl }}}{config.relative_path}/{allCategoriesUrl}{{{ else }}}#{{{ end }}}">
|
<a class="dropdown-item rounded-1 d-flex align-items-center gap-2" role="menuitem" href="{{{ if allCategoriesUrl }}}{config.relative_path}/{allCategoriesUrl}{{{ else }}}#{{{ end }}}">
|
||||||
<div class="flex-grow-1">[[unread:all-categories]]</div>
|
<div class="flex-grow-1 d-flex gap-1 align-items-center">
|
||||||
|
<span class="icon d-inline-flex justify-content-center align-items-center align-middle rounded" style="width:24px; height: 24px; font-size: 12px;"><i class="fa fa-fw fa-list text-secondary"></i></span>
|
||||||
|
<span>[[unread:all-categories]]</span>
|
||||||
|
</div>
|
||||||
<i component="category/select/icon" class="flex-shrink-0 fa fa-fw fa-check {{{if selectedCategory}}}invisible{{{end}}}"></i>
|
<i component="category/select/icon" class="flex-shrink-0 fa fa-fw fa-check {{{if selectedCategory}}}invisible{{{end}}}"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -33,7 +36,7 @@
|
|||||||
{{{ if ./icon }}}
|
{{{ if ./icon }}}
|
||||||
{buildCategoryIcon(@value, "24px", "rounded-circle")}
|
{buildCategoryIcon(@value, "24px", "rounded-circle")}
|
||||||
{{{ end }}}
|
{{{ end }}}
|
||||||
{./name}
|
<span class="category-name">{./name}</span>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<i component="category/select/icon" class="flex-shrink-0 fa fa-fw fa-check {{{ if !./selected }}}invisible{{{ end }}}"></i>
|
<i component="category/select/icon" class="flex-shrink-0 fa fa-fw fa-check {{{ if !./selected }}}invisible{{{ end }}}"></i>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<button type="button" class="btn btn-ghost btn-sm ff-secondary d-flex align-items-center gap-2 dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button type="button" class="btn btn-ghost btn-sm ff-secondary d-flex align-items-center gap-2 dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<span component="category-selector-selected">
|
<span component="category-selector-selected" class="fw-semibold">
|
||||||
{{{ if (selectedCategory && !showCategorySelectLabel) }}}
|
{{{ if (selectedCategory && !showCategorySelectLabel) }}}
|
||||||
<span class="category-item d-inline-flex align-items-center gap-1">
|
<span class="category-item d-inline-flex align-items-center gap-1">
|
||||||
{buildCategoryIcon(selectedCategory, "24px", "rounded-circle")}
|
{buildCategoryIcon(selectedCategory, "24px", "rounded-circle")}
|
||||||
<span class="fw-semibold">{selectedCategory.name}</span>
|
<span class="category-name">{selectedCategory.name}</span>
|
||||||
</span>
|
</span>
|
||||||
{{{ else }}}
|
{{{ else }}}
|
||||||
<i class="fa fa-fw {{{ if selectCategoryIcon }}}{selectCategoryIcon}{{{ else }}}fa-list{{{ end }}} text-primary"></i>
|
<i class="fa fa-fw {{{ if selectCategoryIcon }}}{selectCategoryIcon}{{{ else }}}fa-list{{{ end }}} text-primary"></i>
|
||||||
<span class="visible-md-inline visible-lg-inline fw-semibold">{{{ if selectCategoryLabel }}}{selectCategoryLabel}{{{ else }}}[[topic:thread-tools.select-category]]{{{ end }}}</span>
|
<span class="d-none d-md-inline">{{{ if selectCategoryLabel }}}{selectCategoryLabel}{{{ else }}}[[topic:thread-tools.select-category]]{{{ end }}}</span>
|
||||||
{{{ end }}}
|
{{{ end }}}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -25,12 +25,12 @@
|
|||||||
<li role="presentation" class="category {{{ if ./disabledClass }}}disabled {{{ end }}}" data-cid="{./cid}" data-name="{./name}" data-parent-cid="{./parentCid}">
|
<li role="presentation" class="category {{{ if ./disabledClass }}}disabled {{{ end }}}" data-cid="{./cid}" data-name="{./name}" data-parent-cid="{./parentCid}">
|
||||||
<a class="dropdown-item rounded-1 {{{ if ./disabledClass }}}disabled{{{ end }}}" role="menuitem" href="#">{./level}
|
<a class="dropdown-item rounded-1 {{{ if ./disabledClass }}}disabled{{{ end }}}" role="menuitem" href="#">{./level}
|
||||||
<span component="category-markup" style="{{{ if ./match }}}font-weight: bold;{{{end}}}">
|
<span component="category-markup" style="{{{ if ./match }}}font-weight: bold;{{{end}}}">
|
||||||
<div class="category-item d-inline-flex align-items-center gap-1">
|
<span class="category-item d-inline-flex align-items-center gap-1">
|
||||||
{{{ if ./icon }}}
|
{{{ if ./icon }}}
|
||||||
{buildCategoryIcon(@value, "24px", "rounded-circle")}
|
{buildCategoryIcon(@value, "24px", "rounded-circle")}
|
||||||
{{{ end }}}
|
{{{ end }}}
|
||||||
{./name}
|
<span class="category-name">{./name}</span>
|
||||||
</div>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user