react-templates/test/data/repeat.rt.js

31 lines
875 B
JavaScript
Raw Normal View History

define([
2014-12-03 10:45:31 +01:00
'react/addons',
'lodash'
], function (React, _) {
2014-11-11 10:27:59 +01:00
'use strict';
function onClick1(items, itemsIndex, evt) {
this.happend(evt);
return false;
}
2014-11-12 23:25:12 +01:00
function onMouseDown2(items, itemsIndex) {
this.happend();
return false;
}
function repeatItems3(items, itemsIndex) {
return React.createElement('div', {}, React.createElement('span', {
'style': {
width: 'auto',
lineHeight: '5px'
},
2014-11-12 23:25:12 +01:00
'onClick': onClick1.bind(this, items, itemsIndex),
'onMouseDown': onMouseDown2.bind(this, items, itemsIndex)
}, 'Mock'));
}
return function () {
return React.createElement.apply(this, _.flatten([
'p',
{},
2014-11-12 23:25:12 +01:00
_.map(this.props.things, repeatItems3.bind(this))
]));
};
});