diff options
Diffstat (limited to 'app/javascript/routes/actions/index.js')
| -rw-r--r-- | app/javascript/routes/actions/index.js | 62 | 
1 files changed, 62 insertions, 0 deletions
| diff --git a/app/javascript/routes/actions/index.js b/app/javascript/routes/actions/index.js new file mode 100644 index 000000000..13b2d60b2 --- /dev/null +++ b/app/javascript/routes/actions/index.js @@ -0,0 +1,62 @@ +const actions = { +  addStop : () => { +    return { +      type: 'ADD_STOP' +    } +  }, +  moveStopUp : (index) => { +    return { +      type: 'MOVE_STOP_UP', +      index +    } +  }, +  moveStopDown : (index) => { +    return { +      type: 'MOVE_STOP_DOWN', +      index +    } +  }, +  deleteStop : (index) => { +    return { +      type: 'DELETE_STOP', +      index +    } +  }, +  updateInputValue : (index, text) => { +    return { +      type : 'UPDATE_INPUT_VALUE', +      index, +      text +    } +  }, +  updateSelectValue: (e, index) => { +    return { +      type :'UPDATE_SELECT_VALUE', +      select_id: e.currentTarget.id, +      select_value: e.currentTarget.value, +      index +    } +  }, +  toggleMap: (index) =>({ +    type: 'TOGGLE_MAP', +    index +  }), +  toggleEdit: (index) =>({ +    type: 'TOGGLE_EDIT', +    index +  }), +  closeMaps: () => ({ +    type : 'CLOSE_MAP' +  }), +  selectMarker: (index, data) =>({ +    type: 'SELECT_MARKER', +    index, +    data +  }), +  unselectMarker: (index) => ({ +    type: 'UNSELECT_MARKER', +    index +  }) +} + +module.exports = actions | 
