Bugfix: Script error when empty autocomplete

This fix is a bit verbose, but I'm basically just setting a class to no results if the create new dialog is not available. For some reason putting the if statement at the class level didn't work.

The change makes sure that there is always an ui-item in the autocomplete list. For some reason jquery autocomplete throws a no value exception if this is not so.