X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4713a14935b83517997f3c88f808eb41da55033d..refs/tags/wordpress-4.1.1-scripts:/wp-includes/js/tinymce/tiny_mce_popup.js?ds=sidebyside diff --git a/wp-includes/js/tinymce/tiny_mce_popup.js b/wp-includes/js/tinymce/tiny_mce_popup.js index 9150f865..733f4397 100644 --- a/wp-includes/js/tinymce/tiny_mce_popup.js +++ b/wp-includes/js/tinymce/tiny_mce_popup.js @@ -249,18 +249,21 @@ var tinyMCEPopup = { * @param {string} element_id Element id to be filled with the color value from the picker. */ pickColor : function(e, element_id) { - this.execCommand('mceColorPicker', true, { - color : document.getElementById(element_id).value, - func : function(c) { - document.getElementById(element_id).value = c; - - try { - document.getElementById(element_id).onchange(); - } catch (ex) { - // Try fire event, ignore errors - } - } - }); + var el = document.getElementById(element_id), colorPickerCallback = this.editor.settings.color_picker_callback; + if (colorPickerCallback) { + colorPickerCallback.call( + this.editor, + function (value) { + el.value = value; + try { + el.onchange(); + } catch (ex) { + // Try fire event, ignore errors + } + }, + el.value + ); + } }, /**