You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by se...@apache.org on 2012/03/24 12:21:34 UTC

svn commit: r1304770 - in /incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts: dragEvent.lzx lzDayView.lzx

Author: sebawagner
Date: Sat Mar 24 11:21:34 2012
New Revision: 1304770

URL: http://svn.apache.org/viewvc?rev=1304770&view=rev
Log:
IN PROGRESS - issue OPENMEETINGS-7: Replace lzCalendar with non CPL implementation 
https://issues.apache.org/jira/browse/OPENMEETINGS-7 - Fix drag position in week/day view: fix initial 250ms gap, show snap to 30 minutes while dragging

Modified:
    incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/dragEvent.lzx
    incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/lzDayView.lzx

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/dragEvent.lzx
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/dragEvent.lzx?rev=1304770&r1=1304769&r2=1304770&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/dragEvent.lzx (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/dragEvent.lzx Sat Mar 24 11:21:34 2012
@@ -124,11 +124,17 @@
 				if (currentOverTrackView == null) {
 					return;
 				}
-				if (this.y < 0) {
+				
+				var heightInMinutes = parent.height/1440;
+				var tPixels30Minutes = heightInMinutes*30;
+				var tNewY = Math.round(this.y/tPixels30Minutes)*tPixels30Minutes;
+				if (tNewY < 0) {
 					this.setAttribute("y",0);
-				} else if (this.y + this.height > parent.height) {
+				} else if (tNewY + this.height > parent.height) {
 					this.setAttribute("y",parent.height-this.height);
-				} 
+				} else {
+					this.setAttribute("y",tNewY);
+				}
 				this.setAttribute("x",currentOverTrackView.x);
 			
 			]]>

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/lzDayView.lzx
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/lzDayView.lzx?rev=1304770&r1=1304769&r2=1304770&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/lzDayView.lzx (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/layouts/lzDayView.lzx Sat Mar 24 11:21:34 2012
@@ -289,14 +289,9 @@
 										var appointmentId = -1;
 										lz.Track.deactivate(classroot.dayViewTrackGroup);
 										
-										if (classroot.currentOverTrackView == null 
-													|| classroot.currentOverTrackView == parent.parent) {
-											if ($debug) Debug.write("Move to same Date or outside calendar");
-											this.setAttribute("visibility","visible");	
-										} else {
-											appointmentId = Number(this.datapath.xpathQuery('appointmentId/text()'));
-											if ($debug) Debug.write("Move to new Date appointmentId ",appointmentId);
-										}
+										//Fixme: Prevent saving the object if it is dragged 
+										//at the exact same position as it was before
+										appointmentId = Number(this.datapath.xpathQuery('appointmentId/text()'));
 										
 										classroot.currentDragEvent = null;
 										return appointmentId;
@@ -312,13 +307,16 @@
 													&& this.rememberY == this.getMouse("y")) {
 											lz.Timer.addTimer( new LzDelegate( this, "checkIfDragging" ), 250 );			
 										} else {
+											//we need to move the object by the y position that the mouse
+											//was moved since mousedown
+											var tNewY = this.y + (this.getMouse("y") -  this.rememberY);
+										
 											this.startedToDrag = true;
-											classroot.currentOverTrackView = null;
 											classroot.currentOverTrackView = parent.parent;
 											classroot.currentDragEvent = new lz.dragEvent(classroot.dragAndDropArea._content,{
 														x:parent.parent.parent.x,
 														startx:parent.parent.parent.x,
-														y:this.y,
+														y:tNewY,
 														starty:this.y,
 														bgcolor:this.bgcolor,
 														height:this.height,