summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-10 12:59:37 +0100
committerPhil Hughes <me@iamphill.com>2017-05-10 17:20:40 +0100
commit5a5b06de3eb9c9607c31d9e788fec33b2ee8078e (patch)
treeeae73e54256bae686d5ba391105589a46f7793c4
parent5a95d6f8dae00b31b694759c6ddbf6d83b1a7890 (diff)
downloadgitlab-ce-5a5b06de3eb9c9607c31d9e788fec33b2ee8078e.tar.gz
Fixed task status with mobile
-rw-r--r--app/assets/javascripts/issue_show/components/description.vue16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/issue_show/components/description.vue b/app/assets/javascripts/issue_show/components/description.vue
index 298f87b6d22..1f594e0d5ea 100644
--- a/app/assets/javascripts/issue_show/components/description.vue
+++ b/app/assets/javascripts/issue_show/components/description.vue
@@ -56,19 +56,25 @@
});
},
taskStatus() {
- const $issueableHeader = $('.issuable-header');
+ const taskRegexMatches = this.taskStatus.match(/(\d+) of (\d+)/);
+ const $issueableHeader = $('.issuable-meta');
let $tasks = $('#task_status');
let $tasksShort = $('#task_status_short');
- if (this.taskStatus.indexOf('0 of 0') >= 0) {
+ if (this.taskStatus.indexOf('0 of 0') >= 0 || this.taskStatus.trim() === '') {
$tasks.remove();
$tasksShort.remove();
} else if (!$tasks.length && !$tasksShort.length) {
- $tasks = $issueableHeader.append('<span id="task_status"></span>');
- $tasksShort = $issueableHeader.append('<span id="task_status_short"></span>');
+ $tasks = $issueableHeader.append('<span id="task_status" class="hidden-xs hidden-sm"></span>')
+ .find('#task_status');
+ $tasksShort = $issueableHeader.append('<span id="task_status_short" class="hidden-md hidden-lg"></span>')
+ .find('#task_status_short');
}
- $tasks.text(this.taskStatus);
+ if (taskRegexMatches) {
+ $tasks.text(this.taskStatus);
+ $tasksShort.text(`${taskRegexMatches[1]}/${taskRegexMatches[2]} task${taskRegexMatches[2] > 1 ? 's' : ''}`);
+ }
},
},
};