Author: michiel
Date: 2010-06-29 19:28:59 +0200 (Tue, 29 Jun 2010)
New Revision: 42745

Modified:
   
mmbase/trunk/contributions/calendar/src/main/webapp/mmbase/calendar/calendar.js
Log:


Modified: 
mmbase/trunk/contributions/calendar/src/main/webapp/mmbase/calendar/calendar.js
===================================================================
--- 
mmbase/trunk/contributions/calendar/src/main/webapp/mmbase/calendar/calendar.js 
    2010-06-29 17:14:28 UTC (rev 42744)
+++ 
mmbase/trunk/contributions/calendar/src/main/webapp/mmbase/calendar/calendar.js 
    2010-06-29 17:28:59 UTC (rev 42745)
@@ -42,14 +42,16 @@
                if (self.lastClick != null) {
                    var newSelected = self.lastClick.checked;
                    var lastClickValue = parseInt($(self.lastClick).val());
-                   var step = newClickValue > lastClickValue ? 1 : -1;
-                   for (var i = lastClickValue; i <= newClickValue; i += step) 
{
-                       if (newSelected) {
-                           $("td.day_" + i + " 
input[type=checkbox]").attr("checked", "checked");
-                           $("td.day_" + i).addClass("checked");
-                       } else {
-                           $("td.day_" + i + " 
input[type=checkbox]").removeAttr("checked");
-                           $("td.day_" + i).removeClass("checked");
+                   if (newClickValue != lastClickValue) {              
+                       var step = newClickValue > lastClickValue ? 1 : -1;
+                       for (var i = lastClickValue; i != newClickValue; i += 
step) {
+                           if (newSelected) {
+                               $("td.day_" + i + " 
input[type=checkbox]").attr("checked", "checked");
+                               $("td.day_" + i).addClass("checked");
+                           } else {
+                               $("td.day_" + i + " 
input[type=checkbox]").removeAttr("checked");
+                               $("td.day_" + i).removeClass("checked");
+                           }
                        }
                    }
                }

_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to