Update main.js

Sort function template, performs sort option based on option selected from dropdown list.