Created
August 21, 2018 23:16
-
-
Save jeremiahjstanley/b85f195a11d53e4e5bbacd90afa254e1 to your computer and use it in GitHub Desktop.
SadCode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function appendPalette(palette, id) { | |
const project = $.find('.project').filter(project => { | |
if (project.id == palette.project_id) { | |
return project; | |
}; | |
}); | |
if (project) { | |
$('.palette-message').text(''); | |
$(`<section class='palette' id='${palette.id || id.id}'> | |
<span> | |
<h4>${palette.palette_name}</h4> | |
</span> | |
<article class='small-swatch' style='background-color:${palette.color_1}' value='${palette.color_1}'></article> | |
<article class='small-swatch' style='background-color:${palette.color_2}' value='${palette.color_2}'></article> | |
<article class='small-swatch' style='background-color:${palette.color_3}' value='${palette.color_3}'></article> | |
<article class='small-swatch' style='background-color:${palette.color_4}' value='${palette.color_4}'></article> | |
<article class='small-swatch' style='background-color:${palette.color_5}' value='${palette.color_5}'></article> | |
<button class='delete-palette'>X</button> | |
</section>`).appendTo(project) | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment