Added new keyboard shortcut for task view

This commit is contained in:
Frederic Guillot 2016-03-11 22:46:54 -05:00
parent b95375c324
commit 4f54a547fa
8 changed files with 55 additions and 2 deletions

View File

@ -3,6 +3,7 @@ Version 1.0.27 (unreleased)
Improvements:
* Added new keyboard shortcuts for task view
* Always display project name and task title in task views
* Improve automatic action creation
* Move notifications to the bottom of the screen

View File

@ -66,6 +66,13 @@
<li><?= t('Expand/collapse tasks') ?> = <strong>s</strong></li>
<li><?= t('Compact/wide view') ?> = <strong>c</strong></li>
</ul>
<h3><?= t('Task view') ?></h3>
<ul>
<li><?= t('Edit task') ?> = <strong>e</strong></li>
<li><?= t('New subtask') ?> = <strong>s</strong></li>
<li><?= t('New comment') ?> = <strong>c</strong></li>
<li><?= t('New internal link') ?> = <strong>l</strong></li>
</ul>
<h3><?= t('Application') ?></h3>
<ul>
<li><?= t('Open board switcher') ?> = <strong>b</strong></li>

View File

@ -20,7 +20,12 @@
<?php endif ?>
</ul>
</div>
<section class="sidebar-container">
<section
class="sidebar-container" id="task-view"
data-edit-url="<?= $this->url->href('taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"
data-subtask-url="<?= $this->url->href('subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"
data-internal-link-url="<?= $this->url->href('tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"
data-comment-url="<?= $this->url->href('comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>">
<?= $this->render($sidebar_template, array('task' => $task)) ?>

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,7 @@ function App() {
this.column = new Column(this);
this.file = new FileUpload(this);
this.keyboardShortcuts();
this.task.keyboardShortcuts();
this.chosen();
this.poll();

View File

@ -2,6 +2,29 @@ function Task(app) {
this.app = app;
}
Task.prototype.keyboardShortcuts = function() {
var taskView = $("#task-view");
var self = this;
if (taskView.length) {
Mousetrap.bind("e", function() {
self.app.popover.open(taskView.data("edit-url"));
});
Mousetrap.bind("c", function() {
self.app.popover.open(taskView.data("comment-url"));
});
Mousetrap.bind("s", function() {
self.app.popover.open(taskView.data("subtask-url"));
});
Mousetrap.bind("l", function() {
self.app.popover.open(taskView.data("internal-link-url"));
});
}
};
Task.prototype.listen = function() {
var self = this;
var reloadingProjectId = 0;

View File

@ -18,6 +18,14 @@ Vue tableau
- Étendre / replier une tâche = **s**
- Vue compacte / vue étendue = **c**
Vue détaillée d'une tâche
-------------------------
- Modifier une tâche = **e**
- Nouvelle sous-tâche = **s**
- Nouveau commentaire = **c**
- Nouveau lien interne = **l**
Application
-----------

View File

@ -19,6 +19,14 @@ Board view
- Expand/collapse tasks = **s**
- Compact/wide view = **c**
Task view
---------
- Edit task = **e**
- New subtask = **s**
- New comment = **c**
- New internal link = **l**
Application
-----------