mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-13 08:27:51 +00:00
add checks to handleClickOpenConversation()
This commit is contained in:
parent
c282d9fa69
commit
32d6d59ee9
@ -875,14 +875,22 @@ function handleClickOpenProfileModal(event) {
|
||||
}
|
||||
|
||||
function handleClickOpenConversation(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
var elem = $(event.target).closest(event.data.feeder);
|
||||
if (!elem.length) {
|
||||
muteEvent(event, true);
|
||||
return;
|
||||
}
|
||||
|
||||
var elem = $(event.target);
|
||||
var postData = elem.closest(event.data.feeder);
|
||||
var post = {
|
||||
writer: elem.attr('data-screen-name'),
|
||||
id: elem.attr('data-id')
|
||||
};
|
||||
if (!post.writer || !post.id) {
|
||||
muteEvent(event, true);
|
||||
return;
|
||||
}
|
||||
|
||||
event.data.route = '#conversation?post=' + postData.attr('data-screen-name')
|
||||
+ ':post' + postData.attr('data-id');
|
||||
event.data.route = '#conversation?post=' + post.writer + ':post' + post.id;
|
||||
routeOnClick(event);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user