cdmClicked: do not use event.target.parents to figure out if clicked on a heading

This commit is contained in:
Andrew Dolgov 2017-03-06 12:19:13 +03:00
parent 8519c68d93
commit 63f0ed3d9c
2 changed files with 5 additions and 3 deletions

View File

@ -666,7 +666,7 @@ class Feeds extends Handler_Protected {
$reply['content'] .= "</div>";
$reply['content'] .= "<div class=\"cdmContent\" $content_hidden
onclick=\"return cdmClicked(event, $id);\"
onclick=\"return cdmClicked(event, $id, true);\"
id=\"CICD-$id\">";
$reply['content'] .= "<div id=\"POSTNOTE-$id\">";

View File

@ -1479,7 +1479,7 @@ function show_labels_in_headlines(transport) {
}
}
function cdmClicked(event, id) {
function cdmClicked(event, id, in_body) {
//var shift_key = event.shiftKey;
if (!event.ctrlKey && !event.metaKey) {
@ -1521,7 +1521,7 @@ function cdmClicked(event, id) {
return !event.shiftKey;
}
} else if (event.target.parents(".cdmHeader").length > 0) {
} else if (!in_body) {
toggleSelected(id, true);
@ -1535,6 +1535,8 @@ function cdmClicked(event, id) {
toggleUnread(id, 0, false);
openArticleInNewWindow(id);
} else {
return true;
}
var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length