extracted js from views to admin.js, fixed ajax page loading issue