react-stepzilla
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -162,20 +162,18 @@ 'use strict'; | ||
if (this.props.showSteps) { | ||
return this.props.steps.map(function (s, i) { | ||
return _react2.default.createElement( | ||
'li', | ||
{ className: _this2._getClassName("progtrckr", i), onClick: _this2.jumpToStep, key: i, value: i }, | ||
_react2.default.createElement( | ||
'em', | ||
null, | ||
i + 1 | ||
), | ||
_react2.default.createElement( | ||
'span', | ||
null, | ||
_this2.props.steps[i].name | ||
) | ||
); | ||
}); | ||
} | ||
return this.props.steps.map(function (s, i) { | ||
return _react2.default.createElement( | ||
'li', | ||
{ className: _this2._getClassName("progtrckr", i), onClick: _this2.jumpToStep, key: i, value: i }, | ||
_react2.default.createElement( | ||
'em', | ||
null, | ||
i + 1 | ||
), | ||
_react2.default.createElement( | ||
'span', | ||
null, | ||
_this2.props.steps[i].name | ||
) | ||
); | ||
}); | ||
} | ||
@@ -198,7 +196,7 @@ }, { | ||
{ className: 'multi-step full-height', onKeyDown: this.handleKeyDown }, | ||
_react2.default.createElement( | ||
this.props.showSteps ? _react2.default.createElement( | ||
'ol', | ||
{ className: 'progtrckr' }, | ||
this._renderSteps() | ||
), | ||
) : _react2.default.createElement('span', null), | ||
compToRender, | ||
@@ -205,0 +203,0 @@ _react2.default.createElement( |
{ | ||
"name": "react-stepzilla", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "A react multi-step, wizard component for managing data collection via forms and sub components", | ||
@@ -5,0 +5,0 @@ "main": "./dist/main.js", |
@@ -79,2 +79,4 @@ # react stepzilla | ||
#### change log | ||
- 1.5.0 | ||
- update to improve showSteps. prevent UI elements from completed rendering | ||
- 1.4.0 | ||
@@ -81,0 +83,0 @@ - added the option showSteps which hides the top steps if needed |
@@ -131,10 +131,8 @@ import React, { Component, PropTypes } from 'react'; | ||
_renderSteps() { | ||
if (this.props.showSteps) { | ||
return this.props.steps.map((s, i)=> ( | ||
<li className={this._getClassName("progtrckr", i)} onClick={this.jumpToStep} key={i} value={i}> | ||
<em>{i+1}</em> | ||
<span>{this.props.steps[i].name}</span> | ||
</li> | ||
)); | ||
} | ||
return this.props.steps.map((s, i)=> ( | ||
<li className={this._getClassName("progtrckr", i)} onClick={this.jumpToStep} key={i} value={i}> | ||
<em>{i+1}</em> | ||
<span>{this.props.steps[i].name}</span> | ||
</li> | ||
)); | ||
} | ||
@@ -154,5 +152,9 @@ | ||
<ol className="progtrckr"> | ||
{this._renderSteps()} | ||
</ol> | ||
{ | ||
this.props.showSteps | ||
? <ol className="progtrckr"> | ||
{this._renderSteps()} | ||
</ol> | ||
: <span></span> | ||
} | ||
@@ -159,0 +161,0 @@ {compToRender} |
65287
89