bayes: stop onclick event on our button from propagating back to article

This commit is contained in:
Andrew Dolgov 2015-06-18 15:57:17 +03:00
parent 13167d2a2f
commit 5b0cb9aa7f
2 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,8 @@
function bayesTrain(id, train_up) { function bayesTrain(id, train_up, event) {
try { try {
event.stopPropagation();
var query = "backend.php?op=pluginhandler&plugin=af_sort_bayes&method=trainArticle&article_id=" + param_escape(id) + var query = "backend.php?op=pluginhandler&plugin=af_sort_bayes&method=trainArticle&article_id=" + param_escape(id) +
"&train_up=" + param_escape(train_up); "&train_up=" + param_escape(train_up);

View file

@ -117,11 +117,11 @@ class Af_Sort_Bayes extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
return "<img src=\"plugins/af_sort_bayes/thumb_up.png\" return "<img src=\"plugins/af_sort_bayes/thumb_up.png\"
style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\"
onclick=\"bayesTrain(".$line["id"].", true)\" onclick=\"bayesTrain(".$line["id"].", true, event)\"
class='tagsPic' title='".__('+1')."'>" . class='tagsPic' title='".__('+1')."'>" .
"<img src=\"plugins/af_sort_bayes/thumb_down.png\" "<img src=\"plugins/af_sort_bayes/thumb_down.png\"
style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\"
onclick=\"bayesTrain(".$line["id"].", false)\" onclick=\"bayesTrain(".$line["id"].", false, event)\"
class='tagsPic' title='".__('-1')."'>"; class='tagsPic' title='".__('-1')."'>";
} }