Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dijit / _Contained.js @ 12

History | View | Annotate | Download (870 Bytes)

1 9 andrej.cim
/*
2
        Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3
        Available via Academic Free License >= 2.1 OR the modified BSD license.
4
        see: http://dojotoolkit.org/license for details
5
*/
6
7
8
if(!dojo._hasResource["dijit._Contained"]){
9
dojo._hasResource["dijit._Contained"]=true;
10
dojo.provide("dijit._Contained");
11
dojo.declare("dijit._Contained",null,{getParent:function(){
12
var _1=dijit.getEnclosingWidget(this.domNode.parentNode);
13
return _1&&_1.isContainer?_1:null;
14
},_getSibling:function(_2){
15
var _3=this.domNode;
16
do{
17
_3=_3[_2+"Sibling"];
18
}while(_3&&_3.nodeType!=1);
19
return _3&&dijit.byNode(_3);
20
},getPreviousSibling:function(){
21
return this._getSibling("previous");
22
},getNextSibling:function(){
23
return this._getSibling("next");
24
},getIndexInParent:function(){
25
var p=this.getParent();
26
if(!p||!p.getIndexOfChild){
27
return -1;
28
}
29
return p.getIndexOfChild(this);
30
}});
31
}