Skip to content

Commit

Permalink
Idiot
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Oct 30, 2016
1 parent 82c98ab commit b656dca
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions views/colours.erb
Original file line number Diff line number Diff line change
Expand Up @@ -180,45 +180,45 @@ data = fields()
render(data)

$('.picker').on('move.spectrum', function (ev, tc) {
/*d = ev.target.id.split('-')
d = ev.target.id.split('-')
x = {}
x[d[1]] = [tc['_r'], tc['_g'], tc['_b']]
y = {}
y[d[0]] = x*/
y[d[0]] = x

$.ajax({
url: '/colours/',
data: JSON.stringify(prepareColourData(ev.target.it, tc)),
data: JSON.stringify(y),
type: 'POST',
contentType: 'application/json'
})
})

$('.picker').on('change.spectrum', function (ev, tc) {
/*d = ev.target.id.split('-')
d = ev.target.id.split('-')
x = {}
x[d[1]] = [tc['_r'], tc['_g'], tc['_b']]
y = {}
y[d[0]] = x*/
y[d[0]] = x

$.ajax({
url: '/colours/',
data: JSON.stringify(prepareColourData(ev.target.it, tc)),
data: JSON.stringify(y),
type: 'POST',
contentType: 'application/json',
complete: refresh
})
})

function prepareColourData(id, tc) {
/*function prepareColourData(id, tc) {
d = id.split('-')
x = {}
x[d[1]] = [tc['_r'], tc['_g'], tc['_b']]
y = {}
y[d[0]] = x
return y
}
}*/

function makeWheel(params) {
return d3.svg.arc()
Expand Down Expand Up @@ -278,7 +278,7 @@ function refresh() {
hideAfterPaletteSelect:true,
preferredFormat: 'rgb',
containerClassName: 'wen-picker ' + id + '-picker',
clickoutFiresChange: true
// clickoutFiresChange: true
})
})
})
Expand Down

0 comments on commit b656dca

Please sign in to comment.