Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dijit / form / HorizontalRule.js

History | View | Annotate | Download (1.27 KB)

1
/*
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.form.HorizontalRule"]){
9
dojo._hasResource["dijit.form.HorizontalRule"]=true;
10
dojo.provide("dijit.form.HorizontalRule");
11
dojo.require("dijit._Widget");
12
dojo.require("dijit._Templated");
13
dojo.declare("dijit.form.HorizontalRule",[dijit._Widget,dijit._Templated],{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerH\"></div>",count:3,container:"containerNode",ruleStyle:"",_positionPrefix:"<div class=\"dijitRuleMark dijitRuleMarkH\" style=\"left:",_positionSuffix:"%;",_suffix:"\"></div>",_genHTML:function(_1,_2){
14
return this._positionPrefix+_1+this._positionSuffix+this.ruleStyle+this._suffix;
15
},_isHorizontal:true,postCreate:function(){
16
var _3;
17
if(this.count==1){
18
_3=this._genHTML(50,0);
19
}else{
20
var i;
21
var _4=100/(this.count-1);
22
if(!this._isHorizontal||this.isLeftToRight()){
23
_3=this._genHTML(0,0);
24
for(i=1;i<this.count-1;i++){
25
_3+=this._genHTML(_4*i,i);
26
}
27
_3+=this._genHTML(100,this.count-1);
28
}else{
29
_3=this._genHTML(100,0);
30
for(i=1;i<this.count-1;i++){
31
_3+=this._genHTML(100-_4*i,i);
32
}
33
_3+=this._genHTML(0,this.count-1);
34
}
35
}
36
this.domNode.innerHTML=_3;
37
}});
38
}