Labels on tasks #25

Merged
konrad merged 22 commits from feature/lables into master 2019-03-07 19:48:40 +00:00
3 changed files with 7 additions and 3 deletions
Showing only changes of commit 56a1754453 - Show all commits

View File

@ -12,7 +12,7 @@
class="tag"
:class="{'disabled': user.infos.id !== l.created_by.id}"
@click="editLabel(l)"
:style="{'background': l.hex_color, 'color': l.hasDarkColor() ? '#4a4a4a' : '#e5e5e5'}"
:style="{'background': l.hex_color, 'color': l.textColor}"
>
<span
v-if="user.infos.id !== l.created_by.id"

View File

@ -245,7 +245,7 @@
tag-placeholder="Add this as new label"
>
<template slot="tag" slot-scope="{ option, remove }">
<span class="tag" :style="{'background': option.hex_color, 'color': option.hasDarkColor() ? '#4a4a4a' : '#e5e5e5'}">
<span class="tag" :style="{'background': option.hex_color, 'color': option.textColor}">
<span>{{ option.title }}</span>
<a class="delete is-small" @click="removeLabel(option)"></a>
</span>

View File

@ -8,7 +8,10 @@ export default class LabelModel extends AbstractModel {
if (this.hex_color === '') {
this.hex_color = 'e8e8e8'
}
this.hex_color = '#' + this.hex_color
if (this.hex_color.substring(0, 1) !== '#') {
this.hex_color = '#' + this.hex_color
}
this.textColor = this.hasDarkColor() ? '#4a4a4a' : '#e5e5e5'
this.created_by = new UserModel(this.created_by)
}
@ -20,6 +23,7 @@ export default class LabelModel extends AbstractModel {
description: '',
created_by: UserModel,
listID: 0,
textColor: '',
created: 0,
updated: 0