]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Bind for UserFlag only if there is a form for it
authorSarven Capadisli <csarven@csarven-laptop.(none)>
Sat, 28 Nov 2009 19:54:32 +0000 (20:54 +0100)
committerSarven Capadisli <csarven@csarven-laptop.(none)>
Sat, 28 Nov 2009 19:54:32 +0000 (20:54 +0100)
plugins/UserFlag/UserFlagPlugin.php

index 1c58a6916ea5dc3a8a86639c08021970428ffa5b..4717a63dd1518d7e47b2bf9e031857159a623c48 100644 (file)
@@ -146,7 +146,7 @@ class UserFlagPlugin extends Plugin
     function onEndShowScripts($action)
     {
         $action->elementStart('script', array('type' => 'text/javascript'));
-        $action->raw('/*<![CDATA[*/ SN.U.FormXHR($(".form_entity_flag")); /*]]>*/');
+        $action->raw('/*<![CDATA[*/ if ($(".form_entity_flag").length > 0) { SN.U.FormXHR($(".form_entity_flag")); } /*]]>*/');
         $action->elementEnd('script');
         return true;
     }