process follow from article menu in the background, do not reload page - hubzilla issue #987
This commit is contained in:
parent
726576363c
commit
c8afde6f87
@ -1005,7 +1005,7 @@ function thread_author_menu($item, $mode = '') {
|
||||
$contact = App::$contacts[$item['author_xchan']];
|
||||
else
|
||||
if($local_channel && $item['author']['xchan_addr'])
|
||||
$follow_url = z_root() . '/follow/?f=&url=' . urlencode($item['author']['xchan_addr']);
|
||||
$follow_url = z_root() . '/follow/?f=&url=' . urlencode($item['author']['xchan_addr']) . '&interactive=0';
|
||||
|
||||
|
||||
if($item['uid'] > 0 && author_is_pmable($item['author'],$contact)) {
|
||||
@ -1051,8 +1051,8 @@ function thread_author_menu($item, $mode = '') {
|
||||
'menu' => 'follow',
|
||||
'title' => t('Connect'),
|
||||
'icon' => 'fw',
|
||||
'action' => '',
|
||||
'href' => $follow_url
|
||||
'action' => 'doFollowAuthor(\'' . $follow_url . '\'); return false;',
|
||||
'href' => '#',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -304,6 +304,12 @@ function insertCommentURL(comment, id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function doFollowAuthor(url) {
|
||||
$.get(url, function(data) { notificationsUpdate(); });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function viewsrc(id) {
|
||||
$.colorbox({href: 'viewsrc/' + id, maxWidth: '80%', maxHeight: '80%' });
|
||||
}
|
||||
|
Reference in New Issue
Block a user