From 81bea17aefb26859f825b9293c7c99192874806e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 8 Nov 2011 20:40:44 +0400 Subject: upgrade Dojo to 1.6.1 --- lib/dijit/form/HorizontalRule.js | 92 ++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 28 deletions(-) (limited to 'lib/dijit/form/HorizontalRule.js') diff --git a/lib/dijit/form/HorizontalRule.js b/lib/dijit/form/HorizontalRule.js index 944282d80..e81805e6e 100644 --- a/lib/dijit/form/HorizontalRule.js +++ b/lib/dijit/form/HorizontalRule.js @@ -1,38 +1,74 @@ /* - Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ -if(!dojo._hasResource["dijit.form.HorizontalRule"]){ -dojo._hasResource["dijit.form.HorizontalRule"]=true; +if(!dojo._hasResource["dijit.form.HorizontalRule"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dijit.form.HorizontalRule"] = true; dojo.provide("dijit.form.HorizontalRule"); dojo.require("dijit._Widget"); dojo.require("dijit._Templated"); -dojo.declare("dijit.form.HorizontalRule",[dijit._Widget,dijit._Templated],{templateString:"
",count:3,container:"containerNode",ruleStyle:"",_positionPrefix:"
",_genHTML:function(_1,_2){ -return this._positionPrefix+_1+this._positionSuffix+this.ruleStyle+this._suffix; -},_isHorizontal:true,postCreate:function(){ -var _3; -if(this.count==1){ -_3=this._genHTML(50,0); -}else{ -var i; -var _4=100/(this.count-1); -if(!this._isHorizontal||this.isLeftToRight()){ -_3=this._genHTML(0,0); -for(i=1;i', + + // 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: '
', + + _genHTML: function(pos, ndx){ + 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; + } +}); + } -- cgit v1.2.3