Prevent dropping in not writable lists
This commit is contained in:
parent
f21d86129b
commit
b2a87ca8bc
3 changed files with 21 additions and 6 deletions
|
@ -328,15 +328,22 @@
|
|||
|
||||
this._$scope.dragover = function($event, item, index) {
|
||||
$('.subtasks-container').removeClass('dropzone-visible');
|
||||
$($event.target).closest('.task-item').children('.subtasks-container').addClass('dropzone-visible');
|
||||
return true;
|
||||
var calendarID = $('li.dndPlaceholder').closest('ol[dnd-list]').attr('calendarID');
|
||||
var calendar = _$listsmodel.getByUri(calendarID);
|
||||
if (calendar.writable) {
|
||||
$($event.target).closest('.task-item').children('.subtasks-container').addClass('dropzone-visible');
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return TasksController;
|
||||
|
||||
})();
|
||||
return new TasksController($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer, SearchBusinessLayer, VTodo);
|
||||
return new TasksController($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer,
|
||||
SearchBusinessLayer, VTodo);
|
||||
}
|
||||
]);
|
||||
|
||||
|
|
|
@ -1119,15 +1119,22 @@ angular.module('Tasks').controller('SettingsController', [
|
|||
|
||||
this._$scope.dragover = function($event, item, index) {
|
||||
$('.subtasks-container').removeClass('dropzone-visible');
|
||||
$($event.target).closest('.task-item').children('.subtasks-container').addClass('dropzone-visible');
|
||||
return true;
|
||||
var calendarID = $('li.dndPlaceholder').closest('ol[dnd-list]').attr('calendarID');
|
||||
var calendar = _$listsmodel.getByUri(calendarID);
|
||||
if (calendar.writable) {
|
||||
$($event.target).closest('.task-item').children('.subtasks-container').addClass('dropzone-visible');
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return TasksController;
|
||||
|
||||
})();
|
||||
return new TasksController($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer, SearchBusinessLayer, VTodo);
|
||||
return new TasksController($scope, $window, $routeParams, TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location, SettingsBusinessLayer,
|
||||
SearchBusinessLayer, VTodo);
|
||||
}
|
||||
]);
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
<div class="subtasks-container"
|
||||
ng-class="{subtaskshidden: hideSubtasks(task)}">
|
||||
<ol dnd-list="draggedTasks"
|
||||
calendarID="{{task.calendar.uri}}"
|
||||
dnd-drop="dropAsSubtask(event, item, index)"
|
||||
dnd-dragover="dragover(event, item, index)">
|
||||
<li class="task-item ui-draggable handler add-subtask"
|
||||
|
|
Loading…
Reference in a new issue