$("#thought-<%= @thought.id %>") .replaceWith("<%= escape_javascript(render partial: 'think_feel_do_engine/thoughts/mutable_thought', object: @thought) %>"); $("#thought-<%= @thought.id %>") .addClass("success"); setTimeout( function() { var tableVars, editedRow; $("#thought-<%= @thought.id %>").removeClass("success"); tableVars = $("#thought-<%= @thought.id %>").parents("table"); editedRow = $("#thought-<%= @thought.id %>").parents("tr"); $("#thought-<%= @thought.id %>").parents("table").ngResponsiveTables({ smallPaddingCharNo: parseInt(tableVars.attr("data-sPCN")), mediumPaddingCharNo: parseInt(tableVars.attr("data-mPCN")), largePaddingCharNo: parseInt(tableVars.attr("data-lPCN")), shiftedIndex: parseInt(tableVars.attr("data-sI")), headerAdjust: (tableVars.attr("data-hA") == "true"), headers: tableVars.attr("data-headers").split() }); editedRow.removeClass("form-table"); }, 150);