diff --git a/app/assets/javascripts/app/lib/app_post/ajax.coffee b/app/assets/javascripts/app/lib/app_post/ajax.coffee index 4bd87c03a..bbe82a457 100644 --- a/app/assets/javascripts/app/lib/app_post/ajax.coffee +++ b/app/assets/javascripts/app/lib/app_post/ajax.coffee @@ -149,10 +149,10 @@ class _ajaxSingleton abortedIds runNextInQueue: => - if @queueList && @queueList[0] - @queueRunning = true - data = @queueList.shift() - @addCurrentRequest(params['id'], data, true) + return if !@queueList || !@queueList[0] + @queueRunning = true + data = @queueList.shift() + @addCurrentRequest(data['id'], data, true) _show_spinner: => @count++ diff --git a/app/assets/javascripts/app/lib/app_post/z_searchable_ajax_select.coffee b/app/assets/javascripts/app/lib/app_post/z_searchable_ajax_select.coffee index 7ec681a9c..a23409d6a 100644 --- a/app/assets/javascripts/app/lib/app_post/z_searchable_ajax_select.coffee +++ b/app/assets/javascripts/app/lib/app_post/z_searchable_ajax_select.coffee @@ -5,7 +5,7 @@ class App.SearchableAjaxSelect extends App.SearchableSelect # convert requested object # e.g. Ticket to ticket or AnotherObject to another_object - objectString = underscored( @options.attribute.object ) + objectString = underscored(@options.attribute.object) # create common accessors @apiPath = App.Config.get('api_path') @@ -45,13 +45,13 @@ class App.SearchableAjaxSelect extends App.SearchableSelect @searchResultCache[@cacheKey] = data # load assets - App.Collection.loadAssets( data.assets ) + App.Collection.loadAssets(data.assets) # get options from search result options = [] for object in data.result if object.type is 'Ticket' - ticket = App.Ticket.find( object.id ) + ticket = App.Ticket.find(object.id) data = name: "##{ticket.number} - #{ticket.title}" value: ticket.id @@ -63,7 +63,7 @@ class App.SearchableAjaxSelect extends App.SearchableSelect value: user.id options.push data else if object.type is 'Organization' - organization = App.Organization.find( object.id ) + organization = App.Organization.find(object.id) data = name: "#{organization.displayName()}" value: organization.id