-
-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Show times icon to remove bookmarks from list modal - Show MUC color for the times icon
- Loading branch information
Showing
4 changed files
with
28 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
import bookmark_item from './item.js'; | ||
import { __ } from 'i18n'; | ||
import { _converse } from '@converse/headless'; | ||
import { html } from "lit"; | ||
import { html } from 'lit'; | ||
|
||
const filterBookmark = (b, text) => b.get('name')?.includes(text) || b.get('jid')?.includes(text); | ||
|
||
/** | ||
* @param {import('../bookmarks-list').default} el | ||
*/ | ||
export default (el) => { | ||
const i18n_placeholder = __('Filter'); | ||
const filter_text = el.model.get('text'); | ||
const { bookmarks } = _converse.state; | ||
const shown_bookmarks = filter_text ? bookmarks.filter(b => filterBookmark(b, filter_text)) : bookmarks; | ||
const shown_bookmarks = filter_text ? bookmarks.filter((b) => filterBookmark(b, filter_text)) : bookmarks; | ||
|
||
return html` | ||
<form class="converse-form bookmarks-filter"> | ||
<div class="btn-group w-100"> | ||
<input | ||
.value=${filter_text ?? ''} | ||
@keydown="${ev => el.liveFilter(ev)}" | ||
@keydown="${(ev) => el.liveFilter(ev)}" | ||
class="form-control" | ||
placeholder="${i18n_placeholder}"/> | ||
placeholder="${i18n_placeholder}" | ||
/> | ||
<converse-icon size="1em" class="fa fa-times clear-input ${ !filter_text ? 'hidden' : '' }" | ||
@click=${el.clearFilter}> | ||
<converse-icon | ||
size="1em" | ||
class="fa fa-times clear-input ${!filter_text ? 'hidden' : ''}" | ||
@click=${el.clearFilter} | ||
> | ||
</converse-icon> | ||
</div> | ||
</form> | ||
<div class="list-container list-container--bookmarks"> | ||
<div class="items-list bookmarks rooms-list"> | ||
${ shown_bookmarks.map(bm => bookmark_item(bm)) } | ||
</div> | ||
<div class="items-list bookmarks rooms-list">${shown_bookmarks.map((bm) => bookmark_item(bm))}</div> | ||
</div> | ||
`; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters