mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-05 14:41:53 +08:00
Merge pull request #571 from mlorb/ml_sci_316
Remove behavior of not allowing the empty tables in steps [SCI-316]
This commit is contained in:
commit
b930af0033
2 changed files with 3 additions and 21 deletions
|
@ -188,11 +188,9 @@ function formCallback($form) {
|
|||
$form.submit(function(){
|
||||
$(this).find("[data-role='editable-table']").each(function() {
|
||||
var hot = $(this).find(".hot").handsontable('getInstance');
|
||||
if (hot && hot.countEmptyRows() != hot.countRows()) {
|
||||
var contents = $(this).find('.hot-contents');
|
||||
var data = JSON.stringify({data: hot.getData()});
|
||||
contents.attr("value", data);
|
||||
}
|
||||
var contents = $(this).find('.hot-contents');
|
||||
var data = JSON.stringify({data: hot.getData()});
|
||||
contents.attr("value", data);
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
|
@ -531,7 +529,6 @@ $("[data-action='new-step']").on("ajax:success", function(e, data) {
|
|||
function processStep(ev, editMode) {
|
||||
var $form = $(ev.target.form);
|
||||
$form.clearFormErrors();
|
||||
$form.removeBlankExcelTables(editMode);
|
||||
$form.removeBlankFileForms();
|
||||
|
||||
var $fileInputs = $form.find("input[type=file]");
|
||||
|
|
|
@ -21,18 +21,3 @@ $.fn.removeBlankFileForms = function () {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Not the actual Excel tables, but are similar.
|
||||
*/
|
||||
$.fn.removeBlankExcelTables = function (editMode) {
|
||||
if(editMode) {
|
||||
$tables = $(this).find("[data-role='editable-table']");
|
||||
// In edit mode, tables can't be blank
|
||||
$tables.each(function () {
|
||||
if (!$(this).find("td:not(:empty)").length) {
|
||||
$(this).closest("fieldset").remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue