Open comments in board view with a modal dialog instead of tooltip

This commit is contained in:
Frederic Guillot
2017-02-11 17:22:10 -05:00
parent 28052edb22
commit 8bf054a480
26 changed files with 195 additions and 95 deletions

View File

@@ -0,0 +1,29 @@
(function () {
function redirectToTaskView(e) {
var ignoreParentElement = KB.dom(e.target).parent('a, .task-board-change-assignee');
if (ignoreParentElement) {
return;
}
var taskElement = KB.dom(e.target).parent('.task-board');
if (taskElement) {
var taskUrl = KB.dom(taskElement).data('taskUrl');
if (taskUrl) {
window.location = taskUrl;
}
}
}
function openEditTask(e) {
var baseElement = KB.dom(e.target).parent('.task-board-change-assignee');
var url = KB.dom(baseElement).data('url');
if (url) {
KB.modal.open(url, 'medium', false);
}
}
KB.onClick('.task-board *', redirectToTaskView);
KB.onClick('.task-board-change-assignee *', openEditTask);
}());