diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index e6062ced9..b6adab31e 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -16,11 +16,13 @@ class Index extends App.Controller # set title @title 'New Ticket' @form_id = App.ControllerForm.formId() - @navupdate '#ticket_create' @edit_form = undefined + + # set article attributes + default_type = 'call_inbound' if !@type - @type = 'call_inbound' + @type = default_type article_sender_type_map = call_inbound: sender: 'Customer' @@ -36,6 +38,13 @@ class Index extends App.Controller title: 'Email' @article_attributes = article_sender_type_map[@type] + # if no map entry exists, route to default + if !@article_attributes + @navigate '#ticket_create/' + default_type + + # update navbar highlighting + @navupdate '#ticket_create/' + @type + @fetch(params) # lisen if view need to be rerendert