popovers: Rename data-owner-id and data-bot-owner-id to data-user-id.

We rename data-bot-owner-id and data-owner-id, used to open user
profile of bot owners, to data-user-id such that we can make a
global click handler for all of them by making a separate class
in next commit.
This commit is contained in:
sahil839
2020-09-19 17:49:33 +05:30
committed by Tim Abbott
parent fc8ceceb1d
commit 569ef48699
4 changed files with 4 additions and 4 deletions

View File

@@ -853,7 +853,7 @@ exports.register_click_handlers = function () {
});
$("body").on("click", ".bot-owner-name", (e) => {
const user_id = parseInt($(e.target).attr("data-bot-owner-id"), 10);
const user_id = parseInt($(e.target).attr("data-user-id"), 10);
const user = people.get_by_user_id(user_id);
exports.show_user_profile(user);
});

View File

@@ -585,7 +585,7 @@ function handle_reactivation(tbody, status_field) {
function handle_bot_owner_profile(tbody) {
tbody.on("click", ".user_row .view_user_profile", (e) => {
const owner_id = parseInt($(e.target).attr("data-owner-id"), 10);
const owner_id = parseInt($(e.target).attr("data-user-id"), 10);
const owner = people.get_by_user_id(owner_id);
popovers.show_user_profile(owner);
e.stopPropagation();

View File

@@ -29,7 +29,7 @@
{{#if no_owner }}
{{bot_owner_full_name}}
{{else}}
<a data-owner-id="{{bot_owner_id}}" href="#" class="view_user_profile">{{bot_owner_full_name}}</a>
<a data-user-id="{{bot_owner_id}}" href="#" class="view_user_profile">{{bot_owner_full_name}}</a>
{{/if}}
</span>
</td>

View File

@@ -35,7 +35,7 @@
{{#if is_bot}}
{{#if bot_owner}}
<li>{{#tr this}}Owner{{/tr}}:
<span class="bot-owner-name" data-bot-owner-id='{{ bot_owner.user_id }}'>
<span class="bot-owner-name" data-user-id='{{ bot_owner.user_id }}'>
{{bot_owner.full_name}}
</span>
</li>