]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/tiny_mce_popup.js
WordPress 4.1
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / tiny_mce_popup.js
index 9150f8654b86b59123bf6eeee1267acfe5c94010..733f4397ed7d3d4f7d53b10b2314a6a5d53c2f23 100644 (file)
@@ -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
+                       );
+               }
        },
 
        /**