Refactored js function
Refactored js function

https://bugzilla.redhat.com/show_bug.cgi?id=1416363

ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic