Class: EditRecipe

EditRecipe()

This is the component for the Edit Recipe Page.

Constructor

new EditRecipe()

Attach shadowroot which contains the edit page materials.
Source:

Members

data

The data needed to populate the materials are passed in as "data".
Source:

Methods

addIngreItems(buttonItem)

Add an ingredient to the bottom of ingredients list
Parameters:
Name Type Description
buttonItem HTMLElement the + button element to add on top of it
Source:

addInstruItems(olItem)

Add an instruction to instructions list
Parameters:
Name Type Description
olItem HTMLElement an ordered HTML list element
Source:
Returns:
Void

leaveEdit(data)

Leave the edit page action
Parameters:
Name Type Description
data Object a JSON object of data to load the view page after edit
Source:
Returns:
Void

removeIngreItem(ingreList)

Removes ingredient div in DOM
Parameters:
Name Type Description
ingreList object list of ingredients
Source:

removeInstruItem(instruList)

Removes the bottom instruction item in list
Parameters:
Name Type Description
instruList object list of instructions
Source:
Returns:
Void

toDelete(data)

Load delete confirmation page with passed in data
Parameters:
Name Type Description
data Object a JSON object of data to load the delete page
Source:
Returns:
Void