]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/themes/advanced/js/color_picker.js
WordPress 3.4-scripts
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / themes / advanced / js / color_picker.js
index cdf8c4c0c4c2f66d6ffa4a5b0b89a8d4d04a3364..3cbf32c4f2fcff1ab7b7463dd20b732fa7213d62 100644 (file)
@@ -1,6 +1,6 @@
 tinyMCEPopup.requireLangPack();
 
-var detail = 50, strhex = "0123456789ABCDEF", i, isMouseDown = false, isMouseOver = false;
+var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
 
 var colors = [
        "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
@@ -266,10 +266,10 @@ function dechex(n) {
 }
 
 function computeColor(e) {
-       var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
+       var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
 
-       x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
-       y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
+       x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
+       y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
 
        partWidth = document.getElementById('colors').width / 6;
        partDetail = detail / 2;