Port cilantro/ui level CoffeeScript file to JavaScript

No need for else since the above `if` returns.