Permalink
Browse files

Fix multiple register

  • Loading branch information...
1 parent ba14e0d commit c4f9f34f0b91e8536ae294a4c81fa3aef002e8ae @pgaultier committed Jun 8, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 Sweeml.php
View
@@ -511,10 +511,11 @@ public static function registerEventScript($eventName, $action, $context=null) {
*/
public static function registerEvent($eventName, $action, $context=null) {
$js = self::registerEventScript($eventName, $action, $context);
+ $eventName = $eventName.'-'.md5($js); // allow multiple register if code is not identical
if($context === null) {
Yii::app()->getClientScript()->registerScript($eventName, $js, CClientScript::POS_HEAD);
} else {
Yii::app()->getClientScript()->registerScript($context.'-'.$eventName, $js, CClientScript::POS_HEAD);
}
}
-}
+}

0 comments on commit c4f9f34

Please sign in to comment.