diff options
author | John McLear <john@mclear.co.uk> | 2012-04-19 08:37:09 -0700 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2012-04-19 08:37:09 -0700 |
commit | 4a7ab12859e9895921e3d2c331f4f69e6025d094 (patch) | |
tree | 675d66abfc52e9e1ad3440c6df900c9f0851813d | |
parent | 9fe8a7530da7b0a4fc8042bfabd3010091d25907 (diff) | |
parent | 576fe06682fcf96a80bcb4988b183fcdf352832d (diff) | |
download | etherpad-lite-4a7ab12859e9895921e3d2c331f4f69e6025d094.zip |
Merge pull request #649 from rassie/patch-1
Corrected color picker: `jQuery(...).css('background-color')` returns…
-rw-r--r-- | src/static/js/pad_userlist.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js index f7ee8143..c5f128b7 100644 --- a/src/static/js/pad_userlist.js +++ b/src/static/js/pad_userlist.js @@ -748,13 +748,14 @@ function closeColorPicker(accept) var newColor = $("#mycolorpickerpreview").css("background-color"); var parts = newColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); // parts now should be ["rgb(0, 70, 255", "0", "70", "255"] - delete (parts[0]); - for (var i = 1; i <= 3; ++i) { - parts[i] = parseInt(parts[i]).toString(16); - if (parts[i].length == 1) parts[i] = '0' + parts[i]; + if (parts) { + delete (parts[0]); + for (var i = 1; i <= 3; ++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; pad.notifyChangeColor(newColor); paduserlist.renderMyUserInfo(); |