From ddd82175d2f3c01e37218dbb34a7e3bffa213da7 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 11 Nov 2015 16:54:00 +0000 Subject: [PATCH] Don't even start the drag if you do not have edit permission --- calendar/js/et2_widget_planner.js | 6 ++++-- calendar/js/et2_widget_timegrid.js | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/calendar/js/et2_widget_planner.js b/calendar/js/et2_widget_planner.js index 55f5ccd630..bab05c248e 100644 --- a/calendar/js/et2_widget_planner.js +++ b/calendar/js/et2_widget_planner.js @@ -291,8 +291,10 @@ var et2_calendar_planner = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResize }); // Customize and override some draggable settings - this.div.on('dragcreate','.calendar_calEvent:not(.rowNoEdit)', function(event,ui) { - $j(this).draggable('option','cursorAt',false); + this.div.on('dragcreate','.calendar_calEvent', function(event, ui) { + $j(this).draggable('option','cancel','.rowNoEdit'); + // Act like you clicked the header, makes it easier to position + $j(this).draggable('option','cursorAt', {top: 5, left: 5}); }) .on('dragstart', '.calendar_calEvent', function(event,ui) { $j('.calendar_calEvent',ui.helper).width($j(this).width()) diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 6f153455b7..2d0401cdcf 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -285,7 +285,9 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz }); // Customize and override some draggable settings - this.div.on('dragcreate','.calendar_calEvent:not(.rowNoEdit)', function(event,ui) { + this.div + .on('dragcreate','.calendar_calEvent', function(event, ui) { + $j(this).draggable('option','cancel','.rowNoEdit'); // Act like you clicked the header, makes it easier to position $j(this).draggable('option','cursorAt', {top: 5, left: 5}); })