(js) Fix drag'n'drop in month view

pull/207/head
Francis Lachapelle 2016-05-06 15:45:42 -04:00
parent bf5bee87e6
commit 8789db67b3
3 changed files with 16 additions and 8 deletions

View File

@ -5,11 +5,14 @@
/*
* sgCalendarMonthDay - Build list of blocks for a specific day in a month
* @memberof SOGo.Common
* @memberof SOGo.SchedulerUI
* @restrict element
* @param {object} sgBlocks - the events blocks definitions for the current view
* @param {string} sgDay - the day of the events to display
* @ngInject
* @param {function} sgClick - the function to call when clicking on a block.
* Two variables are available: event (the event that triggered the mouse click),
* and component (a Component object)
*
* @example:
<sg-calendar-monh-day

View File

@ -129,11 +129,15 @@
}
function getMaxColumns() {
var max = 0;
var mdGridList, max = 0;
//if (type == 'multiday') {
if (type == 'monthly') {
mdGridList = scrollView.getElementsByTagName('md-grid-list')[0];
max = parseInt(mdGridList.attributes['md-cols'].value) - 1;
}
else {
max = scrollView.getElementsByClassName('day').length - 1;
//}
}
return max;
}

View File

@ -566,6 +566,7 @@
if (pxCoordinates) {
coordinates = new SOGoCoordinates();
var maxX = view.maxX;
var daysTopOffset = 0;
var dayWidth = view.dayWidth;
var daysOffset = view.daysOffset;
@ -577,9 +578,9 @@
coordinates.x = Math.floor((pxCoordinates.x - daysOffset) / dayWidth);
if (coordinates.x < 0)
coordinates.x = 0;
else if (coordinates.x > 6)
coordinates.x = 6;
coordinates.x += 7 * daysY;
else if (coordinates.x > maxX)
coordinates.x = maxX;
coordinates.x += (maxX + 1) * daysY;
coordinates.y = 0;
}
else {