Refactoring of modal api.
This commit is contained in:
parent
6f05bf7c61
commit
62987c82e8
2 changed files with 7 additions and 26 deletions
|
@ -1,26 +1,24 @@
|
|||
class App.TicketCustomer extends App.ControllerModal
|
||||
constructor: ->
|
||||
super
|
||||
@render()
|
||||
|
||||
render: ->
|
||||
configure_attributes = [
|
||||
{ name: 'customer_id', display: 'Customer', tag: 'autocompletion', type: 'text', limit: 100, null: false, relation: 'User', class: 'span5', autocapitalize: false, help: 'Select the new customer of the Ticket.', source: @apiPath + '/users/search', minLengt: 2 },
|
||||
]
|
||||
|
||||
@html App.view('agent_ticket_customer')()
|
||||
|
||||
new App.ControllerForm(
|
||||
el: @el.find('#form-customer'),
|
||||
controller = new App.ControllerForm(
|
||||
model: {
|
||||
configure_attributes: configure_attributes,
|
||||
className: 'update',
|
||||
},
|
||||
autofocus: true,
|
||||
)
|
||||
@hide()
|
||||
@head = 'Change Customer'
|
||||
@close = true
|
||||
@cancel = true
|
||||
@button = true
|
||||
@show( controller.form )
|
||||
|
||||
submit: (e) =>
|
||||
onSubmit: (e) =>
|
||||
e.preventDefault()
|
||||
|
||||
params = @formParam(e.target)
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<form>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div class="modal-close js-close">
|
||||
<div class="close icon"></div>
|
||||
</div>
|
||||
<h1 class="modal-title"><%- @T( 'Change Customer' ) %></h1>
|
||||
</div>
|
||||
<div class="modal-body" id="form-customer"></div>
|
||||
<div class="modal-footer horizontal">
|
||||
<a class="subtle-link standalone js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
|
||||
<button type="submit" class="btn btn-create js-submit align-right"><%- @T( 'Submit' ) %></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
Loading…
Reference in a new issue