input view working for back button and refresh

input view working for back button and refresh
DRY: this duplicated code in master.js