From 7bfb62d5aea0fe67f7665f4134e378e334df72da Mon Sep 17 00:00:00 2001 From: ClemDee Date: Wed, 19 Jun 2019 14:35:56 +0200 Subject: [PATCH] Fix default color check in palette --- www/drive/app-drive.less | 6 +++++- www/drive/inner.js | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/www/drive/app-drive.less b/www/drive/app-drive.less index 41e59983f..6b638aafe 100644 --- a/www/drive/app-drive.less +++ b/www/drive/app-drive.less @@ -207,13 +207,17 @@ position: absolute; top: -1px; left: 0; width: 200%; - border: 1px solid #666; + border: 1px solid #bbb; transform-origin: top left; -ms-transform-origin: top left; transform: rotate(45deg); -ms-transform: rotate(45deg); -webkit-transform: rotate(45deg); } + &.cp-app-drive-current-color > .fa-check { + top: 35%; left: 35%; + color: black; + } } .cp-app-drive-icon-folder { diff --git a/www/drive/inner.js b/www/drive/inner.js index 44c00dcf1..9bc285a0d 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -876,8 +876,17 @@ define([ var element; if (i === 0) { - element = h("span.cp-app-drive-color-picker-color.cp-app-drive-no-color"); + element = h("span.cp-app-drive-color-picker-color.cp-app-drive-no-color", [ + h("span.fa.fa-check") + ]); + if (currentColor === "") { + currentElement = element; + $(element).addClass("cp-app-drive-current-color"); + } $(element).on("click", function () { + $(currentElement).removeClass("cp-app-drive-current-color"); + currentElement = element; + $(element).addClass("cp-app-drive-current-color"); cb(""); }); colorsElements.push(element); @@ -907,7 +916,7 @@ define([ var getFolderColor = function (path) { if (path.length === 0) { return; } - return manager.getFolderData(path).color || "#000"; + return manager.getFolderData(path).color || ""; }; var setFolderColor = function ($element, path, color) {