Add js method to config element