new.js.erb 592 B

12345678910111213141516
  1. $('#dialog h3.modal-title').html("Registro de <%= @sale.credit? ? 'abono' : 'pago' %>");
  2. $('#dialog').modal({ closeOnEscape: false });
  3. // Rend$( ".selector" ).dialog({ closeOnEscape: false });er the edit form
  4. <% if @sale.saletype == 'credit' %>
  5. $('.modal-body').html('<%= j render("cash_registers_moves/abonoform") %>');
  6. <% else %>
  7. $('.modal-body').html('<%= j render("cash_registers_moves/form") %>');
  8. <% end %>
  9. // Show the dynamic dialog
  10. $('#dialog').modal("show");
  11. // Set focus to the first element
  12. $('#dialog').on('shown.bs.modal', function () {
  13. $('.first_input').focus();
  14. })