Initial drag'n'drop support in Calendar module

TODO:
- drag'n'drop in month's view;
- drag to create an all-day event;
- drag'n'drop to a calendar in the sidenav;
- touchscreen gestures support.
This commit is contained in:
Francis Lachapelle
2015-11-06 15:15:37 -05:00
parent fc16d6ad90
commit 2e02380a93
18 changed files with 1187 additions and 108 deletions
@@ -6,8 +6,8 @@
/**
* @ngInject
*/
CalendarsController.$inject = ['$scope', '$window', '$mdDialog', '$log', 'sgFocus', 'Dialog', 'sgSettings', 'Calendar', 'User', 'stateCalendars'];
function CalendarsController($scope, $window, $mdDialog, $log, focus, Dialog, Settings, Calendar, User, stateCalendars) {
CalendarsController.$inject = ['$rootScope', '$scope', '$window', '$mdDialog', '$log', 'sgFocus', 'Dialog', 'sgSettings', 'Calendar', 'User', 'stateCalendars'];
function CalendarsController($rootScope, $scope, $window, $mdDialog, $log, focus, Dialog, Settings, Calendar, User, stateCalendars) {
var vm = this;
vm.activeUser = Settings.activeUser;
@@ -42,7 +42,7 @@
_.each(ids, function(id) {
var calendar = Calendar.$get(id);
calendar.$setActivation().then(function() {
$scope.$broadcast('calendars:list');
$rootScope.$emit('calendars:list');
});
});
}
@@ -77,7 +77,7 @@
// Unsubscribe without confirmation
folder.$delete()
.then(function() {
$scope.$broadcast('calendars:list');
$rootScope.$emit('calendars:list');
}, function(data, status) {
Dialog.alert(l('An error occured while deleting the calendar "%{0}".', folder.name),
l(data.error));
@@ -88,7 +88,7 @@
.then(function() {
folder.$delete()
.then(function() {
$scope.$broadcast('calendars:list');
$rootScope.$emit('calendars:list');
}, function(data, status) {
Dialog.alert(l('An error occured while deleting the calendar "%{0}".', folder.name),
l(data.error));