Revision: 2459
          https://sourceforge.net/p/mrbs/code/2459/
Author:   cimorrison
Date:     2012-10-03 12:22:45 +0000 (Wed, 03 Oct 2012)
Log Message:
-----------
Simplified code

Modified Paths:
--------------
    mrbs/branches/flexible_day_end/web/edit_entry.php
    mrbs/branches/flexible_day_end/web/js/edit_entry.js.php

Modified: mrbs/branches/flexible_day_end/web/edit_entry.php
===================================================================
--- mrbs/branches/flexible_day_end/web/edit_entry.php   2012-10-03 11:26:42 UTC 
(rev 2458)
+++ mrbs/branches/flexible_day_end/web/edit_entry.php   2012-10-03 12:22:45 UTC 
(rev 2459)
@@ -145,7 +145,7 @@
            // and if $disabled is set, give the element a class so that the 
JavaScript
            // knows to keep it disabled
            (($disabled) ? " class=\"keep_disabled\"" : "") .
-           " id=\"${prefix}seconds${area['id']}\" name=\"${prefix}seconds\" 
onChange=\"adjustSlotSelectors(this.form)\">\n";
+           " id=\"${prefix}seconds${area['id']}\" name=\"${prefix}seconds\" 
onChange=\"adjustSlotSelectors()\">\n";
   
   // If the last time is the same as or before the start time, then it's 
really on the next day
   if ($first >= $last)
@@ -428,7 +428,7 @@
         var oldArea = currentArea;
         currentArea = area;
         prevStartValue = undefined;
-        adjustSlotSelectors(formObj, oldArea, oldAreaStartValue, 
oldAreaEndValue);
+        adjustSlotSelectors(oldArea, oldAreaStartValue, oldAreaEndValue);
       }
       
       // Create area selector, only if we have Javascript

Modified: mrbs/branches/flexible_day_end/web/js/edit_entry.js.php
===================================================================
--- mrbs/branches/flexible_day_end/web/js/edit_entry.js.php     2012-10-03 
11:26:42 UTC (rev 2458)
+++ mrbs/branches/flexible_day_end/web/js/edit_entry.js.php     2012-10-03 
12:22:45 UTC (rev 2459)
@@ -130,7 +130,7 @@
     prevStartValue = undefined;  <?php // because we don't want 
adjustSlotSelectors() to change the end time ?>
   }
 
-  adjustSlotSelectors(form.get(0)); <?php // need to get the duration right ?>
+  adjustSlotSelectors(); <?php // need to get the duration right ?>
 
 }
 
@@ -706,7 +706,7 @@
 }
   
   
-function adjustSlotSelectors(form, oldArea, oldAreaStartValue, oldAreaEndValue)
+function adjustSlotSelectors(oldArea, oldAreaStartValue, oldAreaEndValue)
 {
   <?php
   // Adjust the start and end time slot select boxes.
@@ -720,12 +720,6 @@
   //     to have a go at finding a time/period in the new area as close
   //     as possible to the one that was selected in the old area.
   ?>
-    
-  if (!form)
-  {
-    return;
-  }
-
   var area = currentArea;
   var enablePeriods = areas[area]['enable_periods'];
   var maxDurationEnabled = areas[area]['max_duration_enabled'];
@@ -746,6 +740,11 @@
   var allDay = $('input[name="all_day"]:visible');
   var allDayKeepDisabled = allDay.hasClass('keep_disabled');
   var startIndex, startValue, endIndex, endValue;
+  
+  if (startSelect.length === 0)
+  {
+    return;
+  }
     
   <?php 
   // If All Day is checked then just set the start and end values to the first
@@ -1067,7 +1066,7 @@
       }
     }
   
-    adjustSlotSelectors(form);
+    adjustSlotSelectors();
     
     <?php
     // If this is an All Day booking then check the All Day box and disable 
the 
@@ -1231,7 +1230,7 @@
     // (1) Go and adjust the start and end time/period select options, because
     //     they are dependent on the start and end dates
     ?>
-    adjustSlotSelectors(document.getElementById('main'));
+    adjustSlotSelectors();
     
     <?php
     // (2) If we're doing Ajax checking of the form then we have to check
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to