Permalink
Browse files

color pickers leak

  • Loading branch information...
Manuel-777 committed Dec 17, 2018
1 parent 740d726 commit e14026d5e7f9924ff4b207d9c6913a252dac59c5
Showing with 25 additions and 16 deletions.
  1. +25 −16 window_main/decks.js
@@ -281,25 +281,34 @@ function createTag(tag, div, showClose = true) {
t.style.backgroundColor = tagCol;

if (tag) {
var colorPick = $(t);
colorPick.spectrum({
showInitial: true,
showAlpha: false,
showButtons: false
});
colorPick.spectrum("set", tagCol);

colorPick.on('move.spectrum', function(e, color) {
let tag = $(this).text();
let col = color.toRgbString();
ipc_send("edit_tag", {tag: tag, color: col});
tags_colors[tag] = col;
$(t).on('click', function(e) {
var colorPick = $(t);
colorPick.spectrum({
showInitial: true,
showAlpha: false,
showButtons: false
});
colorPick.spectrum("set", tagCol);
colorPick.spectrum("show");

colorPick.on('move.spectrum', function(e, color) {
let tag = $(this).text();
let col = color.toRgbString();
ipc_send("edit_tag", {tag: tag, color: col});
tags_colors[tag] = col;

$('.deck_tag').each((index, obj) => {
let tag = $(obj).text();
$(obj).css("background-color", tags_colors[tag])
});
});

$('.deck_tag').each((index, obj) => {
let tag = $(obj).text();
$(obj).css("background-color", tags_colors[tag])
colorPick.on('hide.spectrum', () => {
colorPick.spectrum("destroy");
});
e.stopPropagation();
});

}
else {
$(t).on('click', function(e) {

0 comments on commit e14026d

Please sign in to comment.