Revision: 2225
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2225&view=rev
Author:   cimorrison
Date:     2011-12-31 13:24:49 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Preserved the disabled state of the All Day checkbox when switching between 
areas

Modified Paths:
--------------
    mrbs/trunk/web/Themes/default/header.inc
    mrbs/trunk/web/edit_entry.php

Modified: mrbs/trunk/web/Themes/default/header.inc
===================================================================
--- mrbs/trunk/web/Themes/default/header.inc    2011-12-31 11:32:08 UTC (rev 
2224)
+++ mrbs/trunk/web/Themes/default/header.inc    2011-12-31 13:24:49 UTC (rev 
2225)
@@ -1009,9 +1009,10 @@
     var startKeepDisabled = ($('#' + startId).attr('class') == 
'keep_disabled');
     var endId = "end_seconds" + area;
     var endSelect = form[endId];
+    var endKeepDisabled = ($('#' + endId).attr('class') == 'keep_disabled');
     var allDayId = "all_day" + area;
     var allDay = form[allDayId];
-    var endKeepDisabled = ($('#' + endId).attr('class') == 'keep_disabled');
+    var allDayKeepDisabled = $('#' + allDayId).hasClass('keep_disabled');
     var startIndex, startValue, endIndex, endValue;
     
     <?php 
@@ -1147,7 +1148,7 @@
       endSelect.disabled = newState || endKeepDisabled;
       if (allDay)
       {
-        allDay.disabled = newState;
+        allDay.disabled = newState || allDayKeepDisabled;
       }
     }
 

Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php       2011-12-31 11:32:08 UTC (rev 2224)
+++ mrbs/trunk/web/edit_entry.php       2011-12-31 13:24:49 UTC (rev 2225)
@@ -206,6 +206,12 @@
          (($default_duration_all_day && !isset($id) && !$drag) ? " 
checked=\"checked\"" : "") .
          " name=\"all_day\" type=\"checkbox\" value=\"yes\" 
onclick=\"OnAllDayClick(this)\"".
          ($show_all_day? "" : " style=\"display: none;\" ").
+         // If $display_none or $disabled are set then we'll also disable the 
select so
+         // that there is only one select passing through the variable to the 
handler
+         (($display_none || $disabled) ? " disabled=\"disabled\"" : "") .
+         // and if $disabled is set, give the element a class so that the 
JavaScript
+         // knows to keep it disabled
+         (($disabled) ? " class=\"keep_disabled\"" : "") .
          ">\n";
     if($show_all_day)
     {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to