mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
popovers: Add a clear status option in user popover.
Accomplished by adding a function to clear the status message with an empty string. The html is then updated to reflect changes without a refresh. Currently, it's a small hassle to clear a status message. This option makes things a bit easier. Fixes #11630.
This commit is contained in:
@@ -771,6 +771,18 @@ exports.register_click_handlers = function () {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '.info_popover_actions .clear_status', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var me = $(e.target).parents('ul').attr('data-user-id');
|
||||||
|
user_status.server_update({
|
||||||
|
user_id: me,
|
||||||
|
status_text: '',
|
||||||
|
success: function () {
|
||||||
|
$('.info_popover_actions #status_message').html('');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$('body').on('click', '#user-profile-modal #name #edit-button', function () {
|
$('body').on('click', '#user-profile-modal #name #edit-button', function () {
|
||||||
exports.hide_user_profile();
|
exports.hide_user_profile();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -62,7 +62,10 @@
|
|||||||
{{#if status_text}}
|
{{#if status_text}}
|
||||||
{{#unless is_me}}<hr />{{/unless}}
|
{{#unless is_me}}<hr />{{/unless}}
|
||||||
<li class="user_info_status_text">
|
<li class="user_info_status_text">
|
||||||
{{status_text}}
|
<span id="status_message">
|
||||||
|
{{status_text}}
|
||||||
|
{{#if is_me}}(<a href="#" class="clear_status">{{#tr this}}clear{{/tr}}</a>){{/if}}
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|||||||
@@ -126,6 +126,8 @@ IGNORED_PHRASES = [
|
|||||||
r"^new_emoji$",
|
r"^new_emoji$",
|
||||||
# Used to refer custom time limits
|
# Used to refer custom time limits
|
||||||
r"\bN\b",
|
r"\bN\b",
|
||||||
|
# Capital c feels obtrusive in clear status option
|
||||||
|
r"clear",
|
||||||
|
|
||||||
r"group private messages with __recipient__",
|
r"group private messages with __recipient__",
|
||||||
r"private messages with __recipient__",
|
r"private messages with __recipient__",
|
||||||
|
|||||||
Reference in New Issue
Block a user