diff options
author | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:24 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:26 +0400 |
commit | f0cfe83e3725f9a3928da97a6e3085e79cb25309 (patch) | |
tree | 4b0af188defaa807c7bc6ff3a101b41c9166c463 /lib/dijit/form/HorizontalRule.js.uncompressed.js | |
parent | 9a2885da170ffd64358b99194095851a2d09c1b6 (diff) |
upgrade dojo to 1.8.3 (refs #570)
Diffstat (limited to 'lib/dijit/form/HorizontalRule.js.uncompressed.js')
-rw-r--r-- | lib/dijit/form/HorizontalRule.js.uncompressed.js | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/lib/dijit/form/HorizontalRule.js.uncompressed.js b/lib/dijit/form/HorizontalRule.js.uncompressed.js new file mode 100644 index 000000000..6e9577ddc --- /dev/null +++ b/lib/dijit/form/HorizontalRule.js.uncompressed.js @@ -0,0 +1,69 @@ +define("dijit/form/HorizontalRule", [ + "dojo/_base/declare", // declare + "../_Widget", + "../_TemplatedMixin" +], function(declare, _Widget, _TemplatedMixin){ + +// module: +// dijit/form/HorizontalRule + + +return declare("dijit.form.HorizontalRule", [_Widget, _TemplatedMixin], { + // summary: + // Hash marks for `dijit/form/HorizontalSlider` + + templateString: '<div class="dijitRuleContainer dijitRuleContainerH"></div>', + + // count: Integer + // Number of hash marks to generate + count: 3, + + // container: String + // For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", + // and indicates whether this rule goes above or below the slider. + container: "containerNode", + + // ruleStyle: String + // CSS style to apply to individual hash marks + ruleStyle: "", + + _positionPrefix: '<div class="dijitRuleMark dijitRuleMarkH" style="left:', + _positionSuffix: '%;', + _suffix: '"></div>', + + _genHTML: function(pos){ + return this._positionPrefix + pos + this._positionSuffix + this.ruleStyle + this._suffix; + }, + + // _isHorizontal: [protected extension] Boolean + // VerticalRule will override this... + _isHorizontal: true, + + buildRendering: function(){ + this.inherited(arguments); + + var innerHTML; + if(this.count == 1){ + innerHTML = this._genHTML(50, 0); + }else{ + var i; + var interval = 100 / (this.count-1); + if(!this._isHorizontal || this.isLeftToRight()){ + innerHTML = this._genHTML(0, 0); + for(i=1; i < this.count-1; i++){ + innerHTML += this._genHTML(interval*i, i); + } + innerHTML += this._genHTML(100, this.count-1); + }else{ + innerHTML = this._genHTML(100, 0); + for(i=1; i < this.count-1; i++){ + innerHTML += this._genHTML(100-interval*i, i); + } + innerHTML += this._genHTML(0, this.count-1); + } + } + this.domNode.innerHTML = innerHTML; + } +}); + +}); |