mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 15:05:26 +08:00
Improve clean-up of dropped files [SCI-1747]
This commit is contained in:
parent
e35031dd9a
commit
745dac09a7
2 changed files with 10 additions and 4 deletions
|
@ -123,6 +123,7 @@
|
|||
initPreviewModal();
|
||||
SmartAnnotation.preventPropagation('.atwho-user-popover');
|
||||
TinyMCE.destroyAll();
|
||||
DragNDropSteps.clearFiles();
|
||||
}, 1000);
|
||||
|
||||
})
|
||||
|
@ -148,8 +149,8 @@
|
|||
initializeCheckboxSorting();
|
||||
animateSpinner(null, false);
|
||||
initPreviewModal();
|
||||
|
||||
TinyMCE.refresh()
|
||||
DragNDropSteps.clearFiles();
|
||||
TinyMCE.refresh();
|
||||
$("#new-step-checklists fieldset.nested_step_checklists ul").each(function () {
|
||||
enableCheckboxSorting(this);
|
||||
});
|
||||
|
@ -371,6 +372,7 @@
|
|||
newStepHandler();
|
||||
});
|
||||
toggleButtons(true);
|
||||
DragNDropSteps.clearFiles();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
return filesValid;
|
||||
}
|
||||
|
||||
function clearFiles() {
|
||||
droppedFiles = [];
|
||||
}
|
||||
|
||||
// loops through a list of files and display each file in a separate panel
|
||||
function listItems() {
|
||||
totalSize = 0;
|
||||
|
@ -49,7 +53,6 @@
|
|||
var name = 'step[assets_attributes][' + index + '][file]';
|
||||
fd.append(name, droppedFiles[i]);
|
||||
}
|
||||
droppedFiles = [];
|
||||
filesValid = true;
|
||||
totalSize = 0;
|
||||
_dragNdropAssetsOff();
|
||||
|
@ -144,7 +147,8 @@
|
|||
init: init,
|
||||
appendFilesToForm: appendFilesToForm,
|
||||
listItems: listItems,
|
||||
filesStatus: filesStatus
|
||||
filesStatus: filesStatus,
|
||||
clearFiles: clearFiles
|
||||
});
|
||||
})();
|
||||
|
||||
|
|
Loading…
Reference in a new issue