class Skr.Screens.TimeTracking.EditEntry extends Lanes.React.Component dataObjects: entry: -> @props.event?.get('entry') setDataState: (change) -> if change.event @entry.fromCalEvent(change.event) change.event.set({content: @entry.content}, {silent: true}) @forceUpdate() getTarget: -> return null unless @props.wrapper.isMounted() _.dom(@props.wrapper).el onSave: -> event = @props.event @entry.save().then (te) => event.set(_.extend({editing: false}, te.toCalEvent())) @props.onCancel() unless te.errors componentDidMount: -> _.defer => _.dom(@).qs('input[name=hours]').focusAndSelect() render: -> props = {sm:12, editOnly: true, model: @entry}
Cancel Save