Converting search modal to coffeescript in an attempt to debug the perpetual loading search