Merge pull request #649 from rassie/patch-1
Corrected color picker: `jQuery(...).css('background-color')` returns…pull/658/merge
commit
4a7ab12859
|
@ -748,13 +748,14 @@ function closeColorPicker(accept)
|
||||||
var newColor = $("#mycolorpickerpreview").css("background-color");
|
var newColor = $("#mycolorpickerpreview").css("background-color");
|
||||||
var parts = newColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
var parts = newColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
||||||
// parts now should be ["rgb(0, 70, 255", "0", "70", "255"]
|
// parts now should be ["rgb(0, 70, 255", "0", "70", "255"]
|
||||||
delete (parts[0]);
|
if (parts) {
|
||||||
for (var i = 1; i <= 3; ++i) {
|
delete (parts[0]);
|
||||||
parts[i] = parseInt(parts[i]).toString(16);
|
for (var i = 1; i <= 3; ++i) {
|
||||||
if (parts[i].length == 1) parts[i] = '0' + parts[i];
|
parts[i] = parseInt(parts[i]).toString(16);
|
||||||
|
if (parts[i].length == 1) parts[i] = '0' + parts[i];
|
||||||
|
}
|
||||||
|
var newColor = "#" +parts.join(''); // "0070ff"
|
||||||
}
|
}
|
||||||
var newColor = "#" +parts.join(''); // "0070ff"
|
|
||||||
|
|
||||||
myUserInfo.colorId = newColor;
|
myUserInfo.colorId = newColor;
|
||||||
pad.notifyChangeColor(newColor);
|
pad.notifyChangeColor(newColor);
|
||||||
paduserlist.renderMyUserInfo();
|
paduserlist.renderMyUserInfo();
|
||||||
|
|
Loading…
Reference in New Issue