diff --git a/calendar/js/app.js b/calendar/js/app.js index 0fae265a7d..b4be0f7820 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -213,14 +213,9 @@ app.classes.calendar = AppJS.extend( //Droppable jQuery("div[id^='drop_']").droppable( { - accept:function(dg) + accept:function() { - - var id = dg[0].getAttribute('id'); - var calOwner = id.substring(id.lastIndexOf("_O")+2,id.lastIndexOf("_C")); - var dpOwner = this.getAttribute('data-owner'); - if (dpOwner == null) dpOwner = calOwner; - return dg[0].getAttribute('id').match(/drag/g) && calOwner == dpOwner; + return true; }, tolerance:'pointer', @@ -237,7 +232,7 @@ app.classes.calendar = AppJS.extend( } else { - + jQuery(event.draggable).draggable("option","revert",true); } }, @@ -248,13 +243,13 @@ app.classes.calendar = AppJS.extend( var dgOwner = dgId.substring(dgId.lastIndexOf("_C")+2,dgId.lastIndexOf("")); var dpOwner = ui.target.getAttribute('data-owner'); if (dpOwner == null) dpOwner = dgOwner; - if (dpOwner == dgOwner ) + if (dpOwner === dgOwner ) { - event.helper[0].innerHTML = '
'+timeDemo+'
'; + event.helper[0].innerHTML = '
'+timeDemo+'
'; } else { - event.helper[0].innerHTML = '
' + 'Forbidden' + '
'; + event.helper[0].innerHTML = '
'; } } }); diff --git a/calendar/templates/default/app.css b/calendar/templates/default/app.css index bc03e38eb8..1f83f2e6ea 100644 --- a/calendar/templates/default/app.css +++ b/calendar/templates/default/app.css @@ -542,3 +542,22 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget margin: -2px -1px 0px -2px; width:410px; } +/** + * Calendar Drag and Drop + * + */ +//Class for div to show forbiden drop +.calendar_d-n-d_forbiden +{ + background-color: red; + height: 100%; + width: 100%; + text-align: center; +} +//Class for div to demonstrate dragging time +.calendar_d-n-d_timeCounter +{ + font-size: 1.1em; + font-weight: bold; + text-align: center; +}