Sha256: 99a08447f40b26f79bbb2112dfbfe5338895f14ae9fd855c930d420183b49f0f

Contents?: true

Size: 1.72 KB

Versions: 32

Compression:

Stored size: 1.72 KB

Contents

<% if @r_object.errors.blank? %>
  
  // Updating the edited row and highlighting it
  $('#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>').replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: { @resource_options[:item_name].to_sym => @r_object, i: -1})) %>");
  $("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").css("background-color", "#fffddd");
  
  <% if @resource_options[:show_modal_after_update] %>
    // Showing the saved data in the modal
    var heading = "<%= raw @r_object.try(:display_name) %>";
    var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>";
    showLargeModal(heading, bodyContent, false);
  <% else %>
    // Closing the modal if it is opened
    closeLargeModal();
  <% end %>

  // Showing Growl Like Message
  notifySuccess("<%= @notification[:title] %>", "<%= @notification[:message] %>");

<% else %>

	// Reload the form with errors
	var heading = "Edit '<%= raw @r_object.try(:display_name) %>'";
	var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
	showLargeModal(heading, bodyContent, true);

	// Show Main Error Message on the form
  <% error_message = content_tag(:div, I18n.t('errors.errors_highlighted'), class: "alert alert-danger mt-20") %>
  $("#<%= @resource_options[:item_name] %>_form_error").html("<%= escape_javascript(error_message) %>");
  
  // Initialize WYSIHTML Editor
  $(".wysihtml5").wysihtml5(
    {"stylesheets": '/assets/wysiwyg-color.css'}
  );

  // Showing Growl Like Message
  notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
  
<% end %>

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
kuppayam-0.1.34 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.33 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.32 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.31 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.30 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.29 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.28 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.27 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.26 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.25 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.24 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.23 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.22 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.21 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.20 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.19 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.18 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.17 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.16 app/views/kuppayam/workflows/peacock/update.js.erb
kuppayam-0.1.15 app/views/kuppayam/workflows/peacock/update.js.erb