From 2f01fe57a8d37767827d6db42850aef86a767c53 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Nov 2010 10:39:52 +0300 Subject: add dijit/dojo stuff; initial ui mockup --- lib/dijit/layout/TabController.js | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 lib/dijit/layout/TabController.js (limited to 'lib/dijit/layout/TabController.js') diff --git a/lib/dijit/layout/TabController.js b/lib/dijit/layout/TabController.js new file mode 100644 index 000000000..edb3930c5 --- /dev/null +++ b/lib/dijit/layout/TabController.js @@ -0,0 +1,77 @@ +/* + Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Available via Academic Free License >= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dijit.layout.TabController"]){ +dojo._hasResource["dijit.layout.TabController"]=true; +dojo.provide("dijit.layout.TabController"); +dojo.require("dijit.layout.StackController"); +dojo.require("dijit.Menu"); +dojo.require("dijit.MenuItem"); +dojo.requireLocalization("dijit","common",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); +dojo.declare("dijit.layout.TabController",dijit.layout.StackController,{templateString:"
",tabPosition:"top",buttonWidget:"dijit.layout._TabButton",_rectifyRtlTabList:function(){ +if(0>=this.tabPosition.indexOf("-h")){ +return; +} +if(!this.pane2button){ +return; +} +var _1=0; +for(var _2 in this.pane2button){ +var ow=this.pane2button[_2].innerDiv.scrollWidth; +_1=Math.max(_1,ow); +} +for(_2 in this.pane2button){ +this.pane2button[_2].innerDiv.style.width=_1+"px"; +} +}}); +dojo.declare("dijit.layout._TabButton",dijit.layout._StackButton,{baseClass:"dijitTab",cssStateNodes:{closeNode:"dijitTabCloseButton"},templateString:dojo.cache("dijit.layout","templates/_TabButton.html","
\n
\n
\n \t
\n\t\t \"\"\n\t\t \n\t\t \n\t\t x\n\t\t\t
\n
\n
\n
\n"),scrollOnFocus:false,postMixInProperties:function(){ +if(!this.iconClass){ +this.iconClass="dijitTabButtonIcon"; +} +},postCreate:function(){ +this.inherited(arguments); +dojo.setSelectable(this.containerNode,false); +if(this.iconNode.className=="dijitTabButtonIcon"){ +dojo.style(this.iconNode,"width","1px"); +} +},startup:function(){ +this.inherited(arguments); +var n=this.domNode; +setTimeout(function(){ +n.className=n.className; +},1); +},_setCloseButtonAttr:function(_3){ +this.closeButton=_3; +dojo.toggleClass(this.innerDiv,"dijitClosable",_3); +this.closeNode.style.display=_3?"":"none"; +if(_3){ +var _4=dojo.i18n.getLocalization("dijit","common"); +if(this.closeNode){ +dojo.attr(this.closeNode,"title",_4.itemClose); +} +var _4=dojo.i18n.getLocalization("dijit","common"); +this._closeMenu=new dijit.Menu({id:this.id+"_Menu",dir:this.dir,lang:this.lang,targetNodeIds:[this.domNode]}); +this._closeMenu.addChild(new dijit.MenuItem({label:_4.itemClose,dir:this.dir,lang:this.lang,onClick:dojo.hitch(this,"onClickCloseButton")})); +}else{ +if(this._closeMenu){ +this._closeMenu.destroyRecursive(); +delete this._closeMenu; +} +} +},_setLabelAttr:function(_5){ +this.inherited(arguments); +if(this.showLabel==false&&!this.params.title){ +this.iconNode.alt=dojo.trim(this.containerNode.innerText||this.containerNode.textContent||""); +} +},destroy:function(){ +if(this._closeMenu){ +this._closeMenu.destroyRecursive(); +delete this._closeMenu; +} +this.inherited(arguments); +}}); +} -- cgit v1.2.3