~cdparra/gelee/trunk

« back to all changes in this revision

Viewing changes to webui/extjs/build/widgets/ColorPalette-min.js

  • Committer: parra
  • Date: 2010-03-15 15:56:56 UTC
  • Revision ID: svn-v4:ac5bba68-f036-4e09-846e-8f32731cc928:trunk/gelee:1448
merged gelee at svn

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Ext JS Library 3.0 RC2
 
3
 * Copyright(c) 2006-2009, Ext JS, LLC.
 
4
 * licensing@extjs.com
 
5
 * 
 
6
 * http://extjs.com/license
 
7
 */
 
8
 
 
9
 
 
10
Ext.ColorPalette=function(config){Ext.ColorPalette.superclass.constructor.call(this,config);this.addEvents('select');if(this.handler){this.on("select",this.handler,this.scope,true);}};Ext.extend(Ext.ColorPalette,Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:'click',ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],onRender:function(container,position){var t=this.tpl||new Ext.XTemplate('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>');var el=document.createElement("div");el.id=this.getId();el.className=this.itemCls;t.overwrite(el,this.colors);container.dom.insertBefore(el,position);this.el=Ext.get(el);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:'a'});if(this.clickEvent!='click'){this.mon(this.el,'click',Ext.emptyFn,this,{delegate:'a',preventDefault:true});}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var s=this.value;this.value=null;this.select(s);}},handleClick:function(e,t){e.preventDefault();if(!this.disabled){var c=t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(c.toUpperCase());}},select:function(color){color=color.replace("#","");if(color!=this.value||this.allowReselect){var el=this.el;if(this.value){el.child("a.color-"+this.value).removeClass("x-color-palette-sel");}
 
11
el.child("a.color-"+color).addClass("x-color-palette-sel");this.value=color;this.fireEvent("select",this,color);}}});Ext.reg('colorpalette',Ext.ColorPalette);
 
 
b'\\ No newline at end of file'