]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/form/HorizontalRule.js.uncompressed.js
1 define("dijit/form/HorizontalRule", [
2 "dojo/_base/declare", // declare
5 ], function(declare
, _Widget
, _TemplatedMixin
){
8 var _Widget = dijit._Widget;
9 var _TemplatedMixin = dijit._TemplatedMixin;
13 // dijit/form/HorizontalRule
15 // Hash marks for `dijit.form.HorizontalSlider`
18 return declare("dijit.form.HorizontalRule", [_Widget
, _TemplatedMixin
], {
20 // Hash marks for `dijit.form.HorizontalSlider`
22 templateString
: '<div class="dijitRuleContainer dijitRuleContainerH"></div>',
25 // Number of hash marks to generate
29 // For HorizontalSlider, this is either "topDecoration" or "bottomDecoration",
30 // and indicates whether this rule goes above or below the slider.
31 container
: "containerNode",
34 // CSS style to apply to individual hash marks
37 _positionPrefix
: '<div class="dijitRuleMark dijitRuleMarkH" style="left:',
38 _positionSuffix
: '%;',
41 _genHTML: function(pos
){
42 return this._positionPrefix
+ pos
+ this._positionSuffix
+ this.ruleStyle
+ this._suffix
;
45 // _isHorizontal: [protected extension] Boolean
46 // VerticalRule will override this...
49 buildRendering: function(){
50 this.inherited(arguments
);
54 innerHTML
= this._genHTML(50, 0);
57 var interval
= 100 / (this.count
-1);
58 if(!this._isHorizontal
|| this.isLeftToRight()){
59 innerHTML
= this._genHTML(0, 0);
60 for(i
=1; i
< this.count
-1; i
++){
61 innerHTML
+= this._genHTML(interval
*i
, i
);
63 innerHTML
+= this._genHTML(100, this.count
-1);
65 innerHTML
= this._genHTML(100, 0);
66 for(i
=1; i
< this.count
-1; i
++){
67 innerHTML
+= this._genHTML(100-interval
*i
, i
);
69 innerHTML
+= this._genHTML(0, this.count
-1);
72 this.domNode
.innerHTML
= innerHTML
;