/*******************************************************************************
 *
 * class UI.Icon
 *
 ******************************************************************************/


Icon.prototype = new Control();
Icon.prototype.constructor = Icon;

function Icon( jquery_element ) {
  Control.call( this, jquery_element );
}

UI.Icon = Icon;

Icon.add = function( properties ) {
  // Build DOM objects.
  var $control = $('<span></span>');
  $control.addClass('control control-icon');
  // Initialize wrapper.
  var $icon = $('<i></i>');
 // var $class = $('"fa fa-address-book"');
  //$icon.addClass( $class );
  $icon.appendTo( $control );
  //$icon.addClass('slider_toggle round');
  var control = new Icon( $control );
  control.update( properties );
  UI.add_event( 'click', $control );
  // Attach to document.
  control.attach();
  return control;
}

Icon.prototype.set_icon = function( value ) {
  $i = this.control.children('i');
  $i.attr("class",value)
  return value;
};

Icon.prototype.set_color = function( value ) {
  $i = this.control.children('i');
  $i.attr("style",value)
  return value;
};

Icon.prototype.set_label = function( value ) {
  $label = this.control.children('span');
  $label.text( value );
  return value;
};

