From 7d082f99e7af10e79263cddde92857c64536202b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Wed, 5 Sep 2018 22:42:24 +0200 Subject: [PATCH] Add colorpicker directive --- css/src/style.scss | 15 +++- img/color_picker.svg | 5 ++ src/components/Colorpicker.vue | 160 ++++++++++++++++++++++++++++++--- src/components/TheList.vue | 7 +- 4 files changed, 172 insertions(+), 15 deletions(-) create mode 100644 img/color_picker.svg diff --git a/css/src/style.scss b/css/src/style.scss index 5b71d70f..b31c9d42 100644 --- a/css/src/style.scss +++ b/css/src/style.scss @@ -187,9 +187,22 @@ justify-content: center; align-items: center; + .color-selector-label { + display: block; + height: 24px; + width: calc(100% / 9) !important; + background-image: url('../img/color_picker.svg'); + background-repeat: no-repeat; + background-position: center center; + + .color-selector { + visibility: hidden; + } + } + li { height: 24px; - width: calc(100% / 10) !important; + width: calc(100% / 9) !important; &.selected { border: 1px solid $gray_dark; diff --git a/img/color_picker.svg b/img/color_picker.svg new file mode 100644 index 00000000..acd651fb --- /dev/null +++ b/img/color_picker.svg @@ -0,0 +1,5 @@ + + + + +image/svg+xmlOpenclipart diff --git a/src/components/Colorpicker.vue b/src/components/Colorpicker.vue index cbcdc9c1..4d47c9a4 100644 --- a/src/components/Colorpicker.vue +++ b/src/components/Colorpicker.vue @@ -2,7 +2,13 @@ Nextcloud - Tasks @author Raimund Schlüßler +@author Raghu Nayyar +@author Georg Ehrke +@author John Molakvoæ @copyright 2018 Raimund Schlüßler +@copyright 2018 Raghu Nayyar +@copyright 2018 Georg Ehrke +@copyright 2018 John Molakvoæ This library is free software; you can redistribute it and/or modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE @@ -20,21 +26,151 @@ License along with this library. If not, see . --> diff --git a/src/components/TheList.vue b/src/components/TheList.vue index 5d7d1fa3..5a2dbb21 100644 --- a/src/components/TheList.vue +++ b/src/components/TheList.vue @@ -107,7 +107,7 @@ License along with this library. If not, see . class="action icon-checkmark" ng-click="saveEdit(calendar)"> - +
@@ -149,7 +149,7 @@ License along with this library. If not, see . class="action icon-checkmark" ng-click="create($event)"> - +
@@ -233,6 +233,9 @@ export default { } url += '?export' return url + }, + setColor: function(calendar, color) { + console.log('Set color of ' + calendar.uri + ' to ' + color) } } }