Skip to content

Commit

Permalink
fix(components): fix todos for data-cycle-ui in some components
Browse files Browse the repository at this point in the history
  • Loading branch information
arlair committed Apr 10, 2016
1 parent e92a337 commit d6b5d00
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/button/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ export function ButtonFactory(sources: any, props$: Observable<ButtonProps>,
[style.inverse]: props.inverse
}, props.className);

//TODO: make an equivalent of data-react-toolbox='radio' for div?
return (
h(element, { props: { className } }, [
h(element, { props: { className }, attrs: { 'data-cycle-ui': 'button' } }, [
//icon ? <FontIcon className={style.icon} value={icon}/> : null,
//label: props.label
// ,
Expand Down
2 changes: 1 addition & 1 deletion src/input/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function InputFactory(sources: any, props$: Observable<InputProps>): Cycl
// TODO: split input into a new function
// TODO: make an equivalent of data-react-toolbox='input' for div?
return (
div( { props: { className: divClassName } }, [
div( { props: { className: divClassName }, attrs: { 'data-cycle-ui': 'input' } }, [
h(props.multiline ? 'textarea' : 'input', {
props: {
className,
Expand Down
3 changes: 1 addition & 2 deletions src/radio/Radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ function RadioFactory(sources: any, props$: Observable<RadioProps>): CycleDomCom

const className = classNames(style[props.checked ? 'radio-checked' : 'radio'], props.className);

//TODO: make an equivalent of data-react-toolbox='radio' for div?
return (
div( { props: { className } } )
div( { props: { className }, attrs: { 'data-cycle-ui': 'radio' } } )
);
});

Expand Down
3 changes: 1 addition & 2 deletions src/radio/RadioButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ function view(sources: any, state$: any) {
const inputClassName = classNames('radioInput', style.input);

//TODO: split input into a new function
//TODO: make an equivalent of data-react-toolbox='radio-button' for div?
return (
div([
label( { props: { className } }, [
label( { props: { className }, attrs: { 'data-cycle-ui': 'radio-button' } }, [
input( { props: {
className: inputClassName,
//TODO: which version?
Expand Down
5 changes: 2 additions & 3 deletions src/radio/RadioGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const { div } = require('cycle-snabbdom');
import * as classNames from 'classnames';
import { RadioButton, RadioButtonProps } from './RadioButton';
/* tslint:disable: no-unused-variable */
const style = require('react-toolbox/lib/radio/style');
/* tslint:enable */
const style = require('react-toolbox/lib/radio/style'); /* tslint:enable */
import { componentFactory } from '../helpers/componentFactory';
import { CycleDomComponent, CycleComponent, CycleUiComponentProps }
from '../helpers/cycleDomInterfaces';
Expand Down Expand Up @@ -52,7 +51,7 @@ function RadioGroupFactory(sources: any, props$: Observable<RadioGroupProps>,
const className = classNames('radioGroup', props.className);

return (
div( { props: { className } },
div( { props: { className }, attrs: { 'data-cycle-ui': 'radio-group' } },
childrenDOMs
)
);
Expand Down

0 comments on commit d6b5d00

Please sign in to comment.