Sha256: 9f0de73aac9eb0b5ae9c9d40562b2e6b71684db7909ac44b69b6727ffb0fead0

Contents?: true

Size: 732 Bytes

Versions: 20

Compression:

Stored size: 732 Bytes

Contents

(function() {
  let edit_clone = $("<tr data-id=<%= object.id %> data-edit='true' style='display: none'></tr>")
  edit_clone.html("<%= j  render partial: 'edit', locals: {singular.to_sym => object, url: url, colspan: controller.default_colspan} %>")
  let top_pos = $('.<%= singular %>-table [data-id=<%= object.id %>]').offset().top
    $('.<%= singular %>-table > tbody > tr[data-id=<%= object.id %>]:not([data-edit=\'true\'])').fadeOut(() => {
      $(edit_clone).insertAfter('.<%= singular %>-table > tbody > tr[data-id=<%= object.id %>]')
      $(edit_clone).fadeIn();

      let fifth_window_height = Number(window.innerHeight*(1/5));
      $('html, body').animate({scrollTop: top_pos - fifth_window_height},500);
  });
})()

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
common_core_js-0.4.7 app/views/common/_common_edit.js.erb
common_core_js-0.4.6 app/views/common/_common_edit.js.erb
common_core_js-0.4.4 app/views/common/_common_edit.js.erb
common_core_js-0.4.3 app/views/common/_common_edit.js.erb
common_core_js-0.4.2 app/views/common/_common_edit.js.erb
common_core_js-0.4.1 app/views/common/_common_edit.js.erb
common_core_js-0.4.0 app/views/common/_common_edit.js.erb
common_core_js-0.3.9 app/views/common/_common_edit.js.erb
common_core_js-0.3.8 app/views/common/_common_edit.js.erb
common_core_js-0.3.7 app/views/common/_common_edit.js.erb
common_core_js-0.3.6 app/views/common/_common_edit.js.erb
common_core_js-0.3.5 app/views/common/_common_edit.js.erb
common_core_js-0.3.4 app/views/common/_common_edit.js.erb
common_core_js-0.3.3 app/views/common/_common_edit.js.erb
common_core_js-0.3.2 app/views/common/_common_edit.js.erb
common_core_js-0.3.1 app/views/common/_common_edit.js.erb
common_core_js-0.3.0 app/views/common/_common_edit.js.erb
common_core_js-0.1.1 app/views/common/_common_edit.js.erb
common_core_js-0.1.0 app/views/common/_common_edit.js.erb
common_core_js-0.0.2.alpha app/views/common/_common_edit.js.erb