lucatros (9) [Avatar] Offline
#1
Is there any reason why you look for the index on the fieldset instead of adding it to the actual button?

You are using:
...
<fieldset id="plant-{{index}}">
...

...
var thisPlantIndex = $(evt.currentTarget).parent().attr("id").split('-')[1];
...


Wouldn't it be easier to add the index to the button so you don't have to deal with parent() and split()?
...
<button class="removePlant" data-index="{{index}}">Remove Plant</button>
...

...
var thisPlantIndex = $(evt.currentTarget).attr("index");
...

stephan.hochhaus (92) [Avatar] Offline
#2
I admit I am not happy with the overall tone of chapter 5, trying to somehow re-work the entire bit, plus adding your remarks. It just feels a bit clumsy compared to the previous chapter.