1
0
mirror of synced 2024-12-14 23:32:53 +01:00
bemaniutils/bemani/frontend/static/components/slider.react.js

28 lines
907 B
JavaScript
Raw Normal View History

/** @jsx React.DOM */
var Slider = React.createClass({
render: function() {
return (
<div
className={"slider " + (this.props.value ? "on" : "off")}
onClick={function(event) {
event.preventDefault();
event.stopPropagation();
if (this.props.onChange) {
this.props.onChange(!this.props.value);
}
}.bind(this)}
>{ this.props.value ?
<span>
<span className="ball on"></span>
<span className="label on">{this.props.on}</span>
</span> :
<span>
<span className="label off">{this.props.off}</span>
<span className="ball off"></span>
</span>
}</div>
);
},
});