mirror of https://github.com/zulip/zulip.git
emoji: Display status emoji as flexboxes in pills.
This commit is contained in:
parent
cbb0cb9a73
commit
b147440c43
|
@ -37,8 +37,18 @@
|
|||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
|
||||
.pill-value {
|
||||
.pill-label {
|
||||
/* Treat as flex container to better position status
|
||||
emoji and control ellipsis on the pill value. */
|
||||
display: flex;
|
||||
/* Allow label to collapse for ellipsis effect. */
|
||||
min-width: 0;
|
||||
align-items: center;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.pill-value {
|
||||
flex: 0 1 auto;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
{{#if has_image}}
|
||||
<img class="pill-image" src="{{img_src}}" />
|
||||
{{/if}}
|
||||
<span class="pill-value">{{ display_value }}
|
||||
<span class="pill-label">
|
||||
<span class="pill-value">{{ display_value }}</span>
|
||||
{{~#if has_status~}}
|
||||
{{~> status_emoji status_emoji_info~}}
|
||||
{{~> status_emoji status_emoji_info~}}
|
||||
{{~/if~}}
|
||||
</span>
|
||||
<div class="exit">
|
||||
|
|
|
@ -158,13 +158,13 @@ run_test("initialize", ({mock_template}) => {
|
|||
let expected_value = `<div class="search_list_item">\n <span>Search for zo</span>\n</div>\n`;
|
||||
assert.equal(opts.highlighter(source[0]), expected_value);
|
||||
|
||||
expected_value = `<div class="search_list_item">\n <span>sent by</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-value"><strong>Zo</strong>e</span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;
|
||||
expected_value = `<div class="search_list_item">\n <span>sent by</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-label">\n <span class="pill-value"><strong>Zo</strong>e</span></span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;
|
||||
assert.equal(opts.highlighter(source[1]), expected_value);
|
||||
|
||||
expected_value = `<div class="search_list_item">\n <span>direct messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-value"><strong>Zo</strong>e</span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;
|
||||
expected_value = `<div class="search_list_item">\n <span>direct messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-label">\n <span class="pill-value"><strong>Zo</strong>e</span></span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;
|
||||
assert.equal(opts.highlighter(source[2]), expected_value);
|
||||
|
||||
expected_value = `<div class="search_list_item">\n <span>group direct messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-value"><strong>Zo</strong>e</span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;
|
||||
expected_value = `<div class="search_list_item">\n <span>group direct messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-label">\n <span class="pill-value"><strong>Zo</strong>e</span></span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;
|
||||
assert.equal(opts.highlighter(source[3]), expected_value);
|
||||
|
||||
/* Test sorter */
|
||||
|
|
Loading…
Reference in New Issue