You have to select "MacOS extended" from the Format dropdown menu, name the partition if you like, then click the Apply button.
When that completes, that space will be formatted, and named with the name you chose (or Untitled if you didn't change the name)
Now, click the restore tab. Drag the Yosemite partition (in the left side list) to the Source line.
Drag the partition that you just created to the Destination line.
Click Apply. Wait for the restore to complete.
Reboot, choosing the first partition as your new boot default. (You may like to rename the second partition (the old one!) so you don't get confused by which boot partition to choose.
When you get booted to the restored partition (which will now be the first partition!), then you SHOULD be able to remove the second partition, and then drag the main partition to the bottom of the partition window, which is the resize to give your main partition access to all of the available space.
Don't forget to click the Apply button to finish the partition change.