Revision: 2689
          https://sourceforge.net/p/mrbs/code/2689/
Author:   cimorrison
Date:     2013-02-10 12:33:02 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
Fixed bug causing interval timer to stop occasionally

Modified Paths:
--------------
    mrbs/trunk/web/js/refresh.js.php
    mrbs/trunk/web/js/resizable.js.php

Modified: mrbs/trunk/web/js/refresh.js.php
===================================================================
--- mrbs/trunk/web/js/refresh.js.php    2013-02-10 11:37:04 UTC (rev 2688)
+++ mrbs/trunk/web/js/refresh.js.php    2013-02-10 12:33:02 UTC (rev 2689)
@@ -81,7 +81,6 @@
     refreshPage = function refreshPage() {
         if (!isHidden() && !refreshPage.disabled)
         {
-          clearInterval(intervalId);
           var data = {ajax: 1, 
                       day: args.day,
                       month: args.month,
@@ -98,14 +97,16 @@
                  function(result){
                      <?php
                      // (1) Empty the existing table in order to get rid of 
events
-                     // and data and prevent memory leaks (2) insert the 
updated 
-                     // table HTML and then (3) trigger a window load event so 
that 
-                     // the resizable bookings are re-created
+                     // and data and prevent memory leaks, (2) insert the 
updated 
+                     // table HTML, (3) clear the existing interval timer and 
then
+                     // (4) trigger a window load event so that the resizable 
bookings
+                     // are re-created and a new interval timer is started
                      ?>
                      if (!isHidden() && !refreshPage.disabled)
                      {
                        table.empty();
                        table.html(result);
+                       window.clearInterval(intervalId);
                        $(window).trigger('load');
                      }
                    },
@@ -114,8 +115,8 @@
       };
     
     <?php
-    // Set an interval timer to refresh the page
-    ?>  
+    // Set an interval timer to refresh the page.
+    ?>
     var intervalId = setInterval(refreshPage, <?php echo $refresh_rate * 1000 
?>);
     
 

Modified: mrbs/trunk/web/js/resizable.js.php
===================================================================
--- mrbs/trunk/web/js/resizable.js.php  2013-02-10 11:37:04 UTC (rev 2688)
+++ mrbs/trunk/web/js/resizable.js.php  2013-02-10 12:33:02 UTC (rev 2689)
@@ -1205,7 +1205,7 @@
             getTableData(table, tableData);
           }
         });
-
+        
       <?php // also need to redraw and recalibrate if the multiple bookings 
are clicked ?>
       table.find('div.multiple_control')
           .click(function() {
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to