Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. define [
  2.   "jquery",
  3.   "lodash",
  4.   "bootstrap.daterangepicker",
  5.   "react",
  6.   "react.select"], ($, _, daterangepicker, React, Select) ->
  7.  
  8.     class SprintDetailView extends React.Component
  9.  
  10.       {div, button, span, select, input, form, i, label} = React.DOM
  11.       ReactSelect = console.log React.createElement(Select, {})
  12.  
  13.       constructor: (props) ->
  14.         console.log div, ReactSelect
  15.         super props
  16.         @state =
  17.           sprintName: props.data.sprintName
  18.  
  19.       changeSprintName: (event)=>
  20.         this.setState
  21.           sprintName: event.target.value
  22.  
  23.       sprintName: =>
  24.         div
  25.           className:"form-group",
  26.           label
  27.             key:0
  28.             htmlFor:"inputName"
  29.             className:"col-lg-2 col-sm-2 control-label",
  30.             this.props.labels.sprintName
  31.           div
  32.             key:1
  33.             className:"col-lg-10"
  34.             ,
  35.             input
  36.               className:"form-control"
  37.               value: this.state.sprintName
  38.               onChange: @changeSprintName
  39.  
  40.       changeSprintName: (event)=>
  41.         this.setState
  42.           sprintDuration: event.target.value
  43.  
  44.       sprintDuration: =>
  45.         div
  46.           className:"form-group",
  47.           label
  48.             key:0
  49.             htmlFor:"inputName"
  50.             className:"col-lg-2 col-sm-2 control-label",
  51.             this.props.labels.sprintName
  52.           div
  53.             key:1
  54.             className:"col-lg-10"
  55.             ,
  56.             ReactSelect
  57.  
  58.       render: =>
  59.         form
  60.           className:"form-horizontal"
  61.           role: "form"
  62.           @sprintName()
  63.           @sprintDuration()
  64.          
  65.  
  66.     props =
  67.       labels:
  68.         sprintName:"Nombre"
  69.         sprintStartDate:"Start Date"
  70.         sprintEndDate:"End Date"
  71.         sprintDuration:"Duration"
  72.       data:
  73.         sprintName: "ok"
  74.    
  75.    
  76. component = React.createElement(SprintDetailView, props)
  77. React.render(component, document.body)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement