Changeset 1641


Ignore:
Timestamp:
2010-08-03 12:24:15 (3 years ago)
Author:
freya
Message:

Add a 'close' method to a control which is responsible for cleaning up the control.
See #252 : control.close needed for close of color input

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-forms/kauri-forms-extra/src/main/kauri/static/color/js/color.js

    r1569 r1641  
    2626    $.extend(ColorControl.prototype.templates, { 
    2727           control :  
    28              "<input type='text'>" 
     28             "<div kauri-role='container'><input type='text' kauri-role='input'></div>" 
    2929    }); 
    3030 
    3131    ColorControl.prototype.initElements = function(create) { 
    3232        var $input = this.getElement(); 
    33         $input.colorInput(); 
     33        this.colorInput = $input.colorInput(); 
    3434    } 
    3535 
     
    5151    } 
    5252 
     53    ColorControl.prototype.close = function(){ 
     54        var $container = this.getElement("container"); 
     55        if($container){ 
     56            $container.remove(); 
     57        }else{ 
     58            var $input = this.getElement(); 
     59            $pickerimg = $input.next(); 
     60            $pickerimg.remove(); 
     61            kf.Control.close(this); 
     62        } 
     63         
     64    } 
     65     
    5366    kf.fieldTypes.put("color", 
    5467        { 
Note: See TracChangeset for help on using the changeset viewer.