瀏覽代碼

- Fixed behaviour of the popup menu (Trac #316): regression on popup menus inside content loaded via Ajax...

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@454 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 年之前
父節點
當前提交
2a47b3fa89
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      application/displayblock.class.inc.php

+ 7 - 1
application/displayblock.class.inc.php

@@ -891,7 +891,13 @@ class MenuBlock extends DisplayBlock
 			$sHtml .= "<li><a href=\"{$aAction['url']}\"$sClass>{$aAction['label']}</a></li>\n";
 		}
 		$sHtml .= "</ul>\n</li>\n</ul></div>\n";
-		$oPage->add_ready_script("$(\"div.itop_popup>ul\").popupmenu();\n");
+		static $bPopupScript = false;
+		if (!$bPopupScript)
+		{
+			// Output this once per page...
+			$oPage->add_ready_script("$(\"div.itop_popup>ul\").popupmenu();\n");
+			$bPopupScript = true;
+		}
 		return $sHtml;
 	}	
 }