mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-07 12:35:27 +00:00
(js) Fix drag'n'drop in month view
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user