Skip to content

Commit

Permalink
OMG it works
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Oct 8, 2016
1 parent c909797 commit 798f9ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions views/colours/d3.erb
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ function refresh() {
$('.picker').each(function() {
var s = this.id.split('-')
$.getJSON('/colours/' + s[0] + '/' + s[1], function (data) {
$('.' + s[0] + '-' + s[1]).attr('fill', 'rgb(' + (data['colour'].join(', ')) + ')')
// $('.' + s[0] + '-' + s[1] + '-disc').attr('stroke', 'rgb(' + (data['colour'].join(', ')) + ')')

if(s[1] == 'face') {
$('#' + s[0] + '-' + s[1]).attr('stroke', 'rgb(' + (data['colour'].join(', ')) + ')')
} else {
$('#' + s[0] + '-' + s[1]).attr('fill', 'rgb(' + (data['colour'].join(', ')) + ')')
}
$('#' + s[0] + '-' + s[1]).spectrum({
color: 'rgb(' + (data['colour'].join(', ')) + ')',
showPalette: true,
Expand Down

0 comments on commit 798f9ec

Please sign in to comment.