matrix: use "$" instead of "i" to represent the index (#320)

This commit is contained in:
jean-emmanuel 2018-06-28 13:10:50 +02:00
parent a53c236afb
commit 1092a122d7
2 changed files with 3 additions and 3 deletions

View file

@ -37,7 +37,7 @@ Creates grid of widgets of a given type
### `props`<i class="dynamic-prop-icon" title="dynamic"></i>
- type: `object`
- default: `{}`
- usage: define a set of property to override the widgets' defaults. [Formulas](../extras/advanced-property-syntax/#formulas) in this field are resolved with an extra variable `i` representing each widget's index
- usage: define a set of property to override the widgets' defaults. [Formulas](../extras/advanced-property-syntax/#formulas) in this field are resolved with an extra variable `$` representing each widget's index

View file

@ -95,10 +95,10 @@ class Matrix extends _matrix_base {
var hashes = [...this.childrenHashes]
this.childrenHashes = []
for (var i in hashes) {
for (var i = 0; i < hashes.length; i++) {
let widget = widgetManager.widgets[hashes[i]],
data = this.resolveProp('props', undefined, false, false, false, {'i':i})
data = this.resolveProp('props', undefined, false, false, false, {'$':i})
Object.assign(widget.props, data)
widget.updateProps(Object.keys(data), this)