Restore task title link on board

This commit is contained in:
Frederic Guillot
2017-03-19 17:44:43 -04:00
parent b27a7db354
commit 6bd0ce25c9
4 changed files with 17 additions and 11 deletions

View File

@@ -28,7 +28,7 @@
<?= $this->text->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> <?= $this->text->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?>
</span> - </span> -
<?php endif ?> <?php endif ?>
<?= $this->text->e($task['title']) ?> <?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'tooltip', $this->text->e($task['title'])) ?>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="task-board-expanded"> <div class="task-board-expanded">
@@ -51,7 +51,7 @@
<?= $this->hook->render('template:board:private:task:before-title', array('task' => $task)) ?> <?= $this->hook->render('template:board:private:task:before-title', array('task' => $task)) ?>
<div class="task-board-title"> <div class="task-board-title">
<?= $this->text->e($task['title']) ?> <?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</div> </div>
<?= $this->hook->render('template:board:private:task:after-title', array('task' => $task)) ?> <?= $this->hook->render('template:board:private:task:after-title', array('task' => $task)) ?>

File diff suppressed because one or more lines are too long

View File

@@ -24,6 +24,6 @@
} }
} }
KB.onClick('.task-board *', redirectToTaskView); KB.onClick('.task-board *', redirectToTaskView, true);
KB.onClick('.task-board-change-assignee *', openEditTask); KB.onClick('.task-board-change-assignee *', openEditTask, true);
}()); }());

View File

@@ -37,8 +37,11 @@ KB.removeListener = function (eventType, callback) {
} }
}; };
KB.onClick = function (selector, callback) { KB.onClick = function (selector, callback, noPreventDefault) {
this.listeners.clicks[selector] = callback; this.listeners.clicks[selector] = {
callback: callback,
noPreventDefault: noPreventDefault === true
};
}; };
KB.onChange = function (selector, callback) { KB.onChange = function (selector, callback) {
@@ -62,8 +65,11 @@ KB.listen = function () {
function onClick(e) { function onClick(e) {
for (var selector in self.listeners.clicks) { for (var selector in self.listeners.clicks) {
if (self.listeners.clicks.hasOwnProperty(selector) && e.target.matches(selector)) { if (self.listeners.clicks.hasOwnProperty(selector) && e.target.matches(selector)) {
e.preventDefault(); if (! self.listeners.clicks[selector].noPreventDefault) {
self.listeners.clicks[selector](e); e.preventDefault();
}
self.listeners.clicks[selector].callback(e);
} }
} }
} }