visual helper while dragging from calendar view to calendarList

This commit is contained in:
Alexandre Cloutier
2014-07-18 09:23:07 -04:00
parent a2a7014140
commit 8f9b24a23f
3 changed files with 37 additions and 11 deletions
@@ -34,6 +34,7 @@
<div class="preload" style="visibility: hidden;">
<img rsrc:src="event-gradient.png"/>
</div>
<img rsrc:src="event7.png" id="DnDCalendarList" style="visibility: hidden;"/>
<div class="menu" id="monthListMenu">
<ul>
<var:foreach list="monthMenuItems" item="monthMenuItem"
+12 -6
View File
@@ -1297,14 +1297,12 @@ DIV#daysView DIV.event.lasts96
DIV.event > DIV.eventInside
{ position: absolute;
overflow: hidden;
width:100%;
top: 0px;
bottom: 0px;
-webkit-border-radius: 2px;
border-radius: 2px; }
DIV.eventInside {
width:100%;
}
border-radius: 2px;
cursor:move; }
DIV.eventInside SPAN.location
{ font-size: smaller; }
@@ -1442,7 +1440,8 @@ DIV.event.draggable:hover DIV.rightDragGrip
#daysView DIV.eventDragGhost > DIV.eventInside
{ padding: 0px;
border-left: 1px solid #555;
border-right: 1px solid #555; }
border-right: 1px solid #555;
}
#daysView DIV.eventDragGhost.startGhost > DIV.eventInside
{ border-top: 1px solid #555; }
@@ -1547,6 +1546,13 @@ DIV#dragDropVisual
padding-top: 5px;
}
#DnDCalendarList
{
position:absolute;
z-index:1;
left:0;
top:0;
}
+24 -5
View File
@@ -975,6 +975,15 @@ function SOGoEventDragLeftPanelController() {
}
SOGoEventDragLeftPanelController.prototype = {
updateLeftPanelVisual : null,
dropCalendar : null,
setLeftPanelVisual: function SEDLPC_setLeftPanelVisual() {
this.updateLeftPanelVisual = $("leftPanel").on("mousemove", function(e){
$("DnDCalendarList").style.left = e.pageX + "px";
$("DnDCalendarList").style.top = e.pageY + "px";
});
},
updateFromPointerHandler: function SEDLPC_updateFromPointerHandler() {
// Highlight the calendar hover
@@ -984,6 +993,7 @@ SOGoEventDragLeftPanelController.prototype = {
var hoverCalendar = $(event).findElement('#calendarList li');
if (hoverCalendar)
hoverCalendar.addClassName('genericHoverClass');
this.dropCalendar = hoverCalendar;
}
}
@@ -1030,6 +1040,7 @@ SOGoEventDragController.prototype = {
this.ghostController.setTitle(this.title);
this.ghostController.setLocation(this.location);
this.ghostController.setFolderClass(this.folderClass);
this.leftPanelController.setLeftPanelVisual();
this.onDragStartBound = this.onDragStart.bindAsEventListener(this);
for (var i = 0; i < eventCells.length; i++) {
@@ -1368,6 +1379,8 @@ SOGoEventDragController.prototype = {
Event.stopObserving(document.body, "mousemove", this.onDragModeBound);
this.onDragStopBound = null;
this.onDragModeBound = null;
$("DnDCalendarList").style.visibility = 'hidden';
this.leftPanelController.updateLeftPanelVisual.stop();
var utilities = SOGoEventDragUtilities();
if (this.dragHasStarted) {
@@ -1384,13 +1397,12 @@ SOGoEventDragController.prototype = {
.getDelta(this.ghostController
.originalCoordinates);
var dropCalendar = $(event).findElement('#calendarList li');
if (dropCalendar != null) {
if (this.leftPanelController.dropCalendar != null) {
$$('#calendarList li').each(function(e) {
e.removeClassName('genericHoverClass');
});
calendarID[0] = this.folderClass.substr(14);
calendarID[1] = dropCalendar.getAttribute("id").substr(1);
calendarID[1] = this.leftPanelController.dropCalendar.getAttribute("id").substr(1);
delta.start = 0;
if (calendarID[0] != calendarID[1])
this.updateDropCallback(this, this.eventCells, delta, calendarID);
@@ -1438,13 +1450,20 @@ SOGoEventDragController.prototype = {
if (this.dragHasStarted) {
var newCoordinates = this.ghostController.pointerHandler.getEventViewCoordinates();
if (newCoordinates == null && this.leftPanelController != null) {
if (this.ghostController.ghosts)
if (this.ghostController.ghosts) {
this.ghostController.hideGhosts();
$("DnDCalendarList").style.visibility = 'visible';
this.leftPanelController.updateLeftPanelVisual.start();
}
this.leftPanelController.updateFromPointerHandler();
}
else {
if (this.ghostController.ghosts == null)
if (this.ghostController.ghosts == null) {
this.ghostController.showGhosts();
$("DnDCalendarList").style.visibility = 'hidden';
this.leftPanelController.updateLeftPanelVisual.stop();
}
this.ghostController.updateFromPointerHandler();
}
}