CRM-14664: js fixes
Merge pull request #3339 from yashodha/CRM-14664

CRM-14664: js fixes