Browse code

Wrap js call to work with jquery.noConflict mode

Benjamin Roth authored on08/03/2016 14:42:52
Showing1 changed files
... ...
@@ -64,7 +64,7 @@ class ContentGallery extends \Contao\ContentGallery
64 64
 
65 65
 			// Inject scripts and css
66 66
 			$GLOBALS['TL_JQUERY'][] = '<script src="/system/modules/eSM_justifiedGallery/assets/lib/justifiedGallery/' . $GLOBALS['TL_ASSETS']['JUSTIFIEDGALLERY'] . '/js/jquery.justifiedGallery.min.js"></script>';
67
-			$GLOBALS['TL_JQUERY'][] = "<script>$('.".$strJgClass."').justifiedGallery(".json_encode($config).");</script>";
67
+			$GLOBALS['TL_JQUERY'][] = "<script>(function($) { $('.".$strJgClass."').justifiedGallery(".json_encode($config).");})(jQuery);</script>";
68 68
 			$GLOBALS['TL_CSS'][] = '/system/modules/eSM_justifiedGallery/assets/lib/justifiedGallery/' . $GLOBALS['TL_ASSETS']['JUSTIFIEDGALLERY'] . '/css/justifiedGallery.min.css';
69 69
 			$GLOBALS['TL_CSS'][] = '/system/modules/eSM_justifiedGallery/assets/css/justifiedGallery.ext.min.css';
70 70
 		}