Fix dashboard popups CRM-12239
[civicrm-core.git] / templates / CRM / common / dashboard.tpl
index 16e1bfa1c24d623469ef172adf4465bb712d3c7e..654950259040201bd3529148ba87b9f640c1db63 100644 (file)
@@ -26,8 +26,7 @@
 {literal}
 <script type="text/javascript">
     
-// Create closure, so that we don't accidentally spoil the global/window namespace.
-cj(function() {
+cj(function($) {
   // The set of options we can use to initialize jQuery.dashboard().
   var options = {
     // Optional. Defaults to 3.  You'll need to change the width of columns in CSS too.
@@ -204,12 +203,10 @@ cj(function() {
     }
   };
 
-  // Initialize the dashboard using these options, and save to the global/window
-  // namesapace so that server-side executable js file callbacks can access
-  // window.dashboardDemo.widgets by ID.
-  window.dashboardDemo = cj('#civicrm-dashboard').dashboard(options);
+  // Initialize the dashboard using these options
+  $('#civicrm-dashboard').dashboard(options);
 
-}); // End closure.
+});
 
 </script>
 {/literal}