fix tab jumping and refactor code in projects.js