]> git.wh0rd.org Git - tt-rss.git/commitdiff
bayes: stop onclick event on our button from propagating back to article
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 18 Jun 2015 12:57:17 +0000 (15:57 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 18 Jun 2015 12:57:17 +0000 (15:57 +0300)
plugins/af_sort_bayes/init.js
plugins/af_sort_bayes/init.php

index 6ea8f6c116e976cb79000f84350df2f33924f24b..6b8dcf78a42efd6d4bad3e20cb44e14c4085af20 100644 (file)
@@ -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);
 
index 3958d27b266849672ef8bc416435509ecc3b078c..51294b46ed9f5fdbc0ce03b93df68e10fb28cf4d 100644 (file)
@@ -117,11 +117,11 @@ class Af_Sort_Bayes extends Plugin {
        function hook_article_button($line) {
                return "<img src=\"plugins/af_sort_bayes/thumb_up.png\"
                        style=\"cursor : pointer\" style=\"cursor : pointer\"
-                       onclick=\"bayesTrain(".$line["id"].", true)\"
+                       onclick=\"bayesTrain(".$line["id"].", true, event)\"
                        class='tagsPic' title='".__('+1')."'>" .
                "<img src=\"plugins/af_sort_bayes/thumb_down.png\"
                        style=\"cursor : pointer\" style=\"cursor : pointer\"
-                       onclick=\"bayesTrain(".$line["id"].", false)\"
+                       onclick=\"bayesTrain(".$line["id"].", false, event)\"
                        class='tagsPic' title='".__('-1')."'>";
 
        }