title: Redactor: dropdown plugin
body: <p>I try to implement a colorpicker-fontcolor plugin to redactor-js.</p>
  
  <p><a href="http://jsfiddle.net/ped7txq6/" rel="nofollow">http://jsfiddle.net/ped7txq6/</a></p>
  
  <pre><code>$(function(){
  
      //plugin
      $.Redactor.prototype.fontcolor = function()
      {
          return {
              init: function()
              {
                  var name = 'fontcolor';
                  var rdctr = this;
  
                  var button = this.button.addAfter('fontsize', name, this.lang.get(name));
                  var $dropdown = this.button.addDropdown(button);
  
                  $dropdown.css('min-width', '199px');
                  this.fontcolor.buildPicker($dropdown, name);
  
                  button.on('click', function(){
  
                      rdctr.selection.save();
  
                  });
              },
              buildPicker: function($dropdown, name)
              {
                  var rdctr = this;
  
                  var $picker = $('&lt;p&gt;').ColorPicker({
                                                      flat: true,
                                                      onSubmit: function(hsb, hex, rgb, el){
                                                      //  $(el).val('#' + hex);
                                                      //  $(el).ColorPickerHide();
                                                      },
                                                      onChange: function(hsb, hex, rgb, el){
                                                      //  $(el).val(hex);
                                                          rdctr.fontcolor.set('color', '#' + hex);
                                                      }
                                                  }).bind('keyup', function(){
                                                      //$(rdctr).ColorPickerSetColor(rdctr.value);
                                                  //  rdctr.fontcolor.set('color', '#' + hex);
  
                                                  });
                  $dropdown.append($picker);
              },
              set: function(rule, type)
              {
                  console.log('_', type);
                  //selected color
                  this.selection.restore();
                  this.inline.format('span', 'style', rule + ':' + type + ';');
              },
              remove: function(rule)
              {
                  //removed color
              //  this.inline.removeStyleRule(rule);
              }
          };
      };
  
      //editor
      $('#redactor').redactor({
  
          plugins: ['fontcolor'],
          focus: true,
          changeCallback: function()
          {
          },
          blurCallback: function()
          {
          }
  
      });
  
  });
  </code></pre>
  
  <p>I have two problem:</p>
  
  <ol>
  <li>When I clicked in the dropdown on the colorpicker, the dropdown is close,</li>
  <li>Sometimes when I selected the color, the text in the editor get the default color, not actual color from colorpicker.</li>
  </ol>
  
  <p>Anyone can help in these?</p>
  
  <p>Thanks a lot!</p>