Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dojox / grid / enhanced / dnd / _DndFocusManager.js

History | View | Annotate | Download (2.22 KB)

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["dojox.grid.enhanced.dnd._DndFocusManager"]){
9
dojo._hasResource["dojox.grid.enhanced.dnd._DndFocusManager"]=true;
10
dojo.provide("dojox.grid.enhanced.dnd._DndFocusManager");
11
dojo.declare("dojox.grid.enhanced.dnd._DndFocusManager",null,{_rowBarNode:null,_rowBarFocusIdy:null,isRowBar:function(){
12
return (!!this._rowBarNode);
13
},getRowBarNode:function(_1){
14
return this.grid.views.views[0].getCellNode(_1,0);
15
},focusRowBar:function(){
16
this.focusRowBarNode(0);
17
this._focusifyCellNode(false);
18
},focusRowBarNode:function(_2){
19
this._blurRowBar();
20
this._focusifyCellNode(false);
21
var _3=this.getRowBarNode(_2);
22
if(!_3){
23
return;
24
}
25
this._rowBarNode=_3;
26
this._rowBarFocusIdy=_2;
27
this._rowBarNode.tabIndex=-1;
28
dojox.grid.util.fire(this._rowBarNode,"focus");
29
dojo.toggleClass(this._rowBarNode,this.focusClass,true);
30
},_blurRowBar:function(){
31
if(this._rowBarNode){
32
dojo.toggleClass(this._rowBarNode,this.focusClass,false);
33
this._rowBarNode=this._rowBarFocusIdy=null;
34
}
35
},focusNextRowBar:function(){
36
var sc=this.grid.scroller,r=this._rowBarFocusIdy,rc=this.grid.rowCount-1,_4=Math.min(rc,Math.max(0,r+1));
37
var _5=this._rowBarFocusIdy+1;
38
if(_4>sc.getLastPageRow(sc.page)){
39
this.grid.setScrollTop(this.grid.scrollTop+sc.findScrollTop(_4)-sc.findScrollTop(r));
40
}
41
this.focusRowBarNode(_5);
42
this.scrollRowBarIntoView();
43
},focusPrevRowBar:function(){
44
var sc=this.grid.scroller,r=this._rowBarFocusIdy,rc=this.grid.rowCount-1,_6=Math.min(rc,Math.max(0,r-1));
45
var _7=this._rowBarFocusIdy-1;
46
if(_7<0){
47
return;
48
}
49
if(_7<=sc.getPageRow(sc.page)){
50
this.grid.setScrollTop(this.grid.scrollTop-sc.findScrollTop(r)-sc.findScrollTop(_6));
51
}
52
this.focusRowBarNode(_7);
53
this.scrollRowBarIntoView();
54
},getFocusedRowIndex:function(){
55
return this._rowBarFocusIdy;
56
},scrollRowBarIntoView:function(){
57
this.cell=this._rowBarNode;
58
this.cell.view=this.grid.views.views[0];
59
this.cell.getNode=function(_8){
60
return this.cell;
61
};
62
this.rowIndex=this._rowBarFocusIdy;
63
this.scrollIntoView();
64
this.cell=null;
65
},focusHeaderNode:function(_9){
66
this._colHeadFocusIdx=_9;
67
this.focusHeader.apply(this,arguments);
68
}});
69
}