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