Moved selection component JS definition in the component file.

References #693.