* @cfg {String} html
* @cfg {String} position (top|bottom) text position default bottom
* @cfg {String} icon show icon instead of number
- * @cfg {Boolean} forceIcon (true|false) true to force show icon..if set to false, Roo.isTouch showing icon, otherwish number
*
* @constructor
* Create a new NavProgressItem
html : '',
position : 'bottom',
icon : false,
- forceIcon : false,
getAutoCreate : function()
{
var iconCls = 'roo-navigation-bar-item-icon';
- if((this.forceIcon && this.icon) || !this.forceIcon && Roo.isTouch){
- iconCls += ' ' + this.icon;
- }
+ iconCls += ((this.icon) ? (' ' + this.icon) : (' step-number')) ;
var cfg = {
tag: 'li',
{
tag : 'i',
cls : iconCls
- },
- {
- tag : 'span',
- cls : 'roo-navigation-bar-item-text ' + this.position,
- html : this.html
}
]
- }
+ };
if(this.active){
cfg.cls += ' active';
return cfg;
},
- render : function(container, position){
- if(!this.rendered && this.fireEvent("beforerender", this) !== false){
- if(!container && this.el){
- this.el = Roo.get(this.el);
- container = this.el.dom.parentNode;
- this.allowDomMove = false;
- }
- this.container = Roo.get(container);
- this.rendered = true;
- if(position !== undefined){
- if(typeof position == 'number'){
- position = this.container.dom.childNodes[position];
- }else{
- position = Roo.getDom(position);
- }
- }
- this.onRender(this.container, position || null);
- if(this.cls){
- this.el.addClass(this.cls);
- delete this.cls;
- }
- if(this.style){
- this.el.applyStyles(this.style);
- delete this.style;
- }
- this.fireEvent("render", this);
- this.afterRender(this.container);
- if(this.hidden){
- this.hide();
- }
- if(this.disabled){
- this.disable();
- }
- }
- return this;
+ disable : function()
+ {
+ this.setDisabled(true);
+ },
+
+ enable : function()
+ {
+ this.setDisabled(false);
},
initEvents: function()
{
this.iconEl = this.el.select('.roo-navigation-bar-item-icon', true).first();
- this.textEl = this.el.select('.roo-navigation-bar-item-text', true).first();
-
- if(Roo.isTouch){
- this.textEl.setVisibilityMode(Roo.Element.DISPLAY).hide();
- }
this.iconEl.on('click', this.onClick, this);
-
},
onClick : function(e)