From 5b0cb9aa7f5088bcf4dbbe614bfee982fbc07d2e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 18 Jun 2015 15:57:17 +0300 Subject: [PATCH] bayes: stop onclick event on our button from propagating back to article --- plugins/af_sort_bayes/init.js | 4 +++- plugins/af_sort_bayes/init.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/af_sort_bayes/init.js b/plugins/af_sort_bayes/init.js index 6ea8f6c1..6b8dcf78 100644 --- a/plugins/af_sort_bayes/init.js +++ b/plugins/af_sort_bayes/init.js @@ -1,6 +1,8 @@ -function bayesTrain(id, train_up) { +function bayesTrain(id, train_up, event) { try { + event.stopPropagation(); + var query = "backend.php?op=pluginhandler&plugin=af_sort_bayes&method=trainArticle&article_id=" + param_escape(id) + "&train_up=" + param_escape(train_up); diff --git a/plugins/af_sort_bayes/init.php b/plugins/af_sort_bayes/init.php index 3958d27b..51294b46 100644 --- a/plugins/af_sort_bayes/init.php +++ b/plugins/af_sort_bayes/init.php @@ -117,11 +117,11 @@ class Af_Sort_Bayes extends Plugin { function hook_article_button($line) { return "" . ""; } -- 2.39.5