3 var React = require('../reactGUI/React-shim');
5 var _require = require('./optionsStyles');
7 var defineOptionsStyle = _require.defineOptionsStyle;
9 var createSetStateOnEventMixin = require('../reactGUI/createSetStateOnEventMixin');
11 defineOptionsStyle('stroke-or-fill', React.createClass({
12 displayName: 'StrokeOrFillPicker',
13 getState: function getState() {
14 return { strokeOrFill: 'stroke' };
16 getInitialState: function getInitialState() {
17 return this.getState();
19 mixins: [createSetStateOnEventMixin('toolChange')],
21 onChange: function onChange(e) {
22 if (e.target.id == 'stroke-or-fill-stroke') {
23 this.props.lc.tool.strokeOrFill = 'stroke';
25 this.props.lc.tool.strokeOrFill = 'fill';
27 this.setState(this.getState());
30 render: function render() {
31 var lc = this.props.lc;
33 return React.createElement(
44 React.createElement('input', { type: 'radio', name: 'stroke-or-fill', value: 'stroke',
45 id: 'stroke-or-fill-stroke', onChange: this.onChange,
46 checked: lc.tool.strokeOrFill == 'stroke' }),
49 { htmlFor: 'stroke-or-fill-stroke', className: 'label' },
56 React.createElement('input', { type: 'radio', name: 'stroke-or-fill', value: 'fill',
57 id: 'stroke-or-fill-fill', onChange: this.onChange,
58 checked: lc.tool.strokeOrFill == 'fill' }),
61 { htmlFor: 'stroke-or-fill-fill', className: 'label' },