1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 17:54:44 +02:00

Add @Toutouwai processwire/processwire-requests#242 to support automatic open of collapsed Inputfield when file dragged into file/image or CKEditor field that supports it

This commit is contained in:
Ryan Cramer
2018-11-08 09:04:04 -05:00
parent 7629e518e3
commit c146c71de3
4 changed files with 15 additions and 2 deletions

View File

@@ -1319,6 +1319,14 @@ function InputfieldStates($target) {
$(document).on('submit', '.InputfieldFormConfirm', function() {
$(this).addClass('InputfieldFormSubmitted');
});
// open Inputfields supporting uploads when file dragged in, per @Toutouwai #242
$(document).on('dragenter', '.InputfieldHasUpload.InputfieldStateCollapsed', function(e) {
var dt = e.originalEvent.dataTransfer;
if(dt.types && (dt.types.indexOf ? dt.types.indexOf('Files') !== -1 : dt.types.contains('Files'))) {
InputfieldOpen($(this));
}
});
window.addEventListener("beforeunload", InputfieldFormBeforeUnloadEvent);
}

File diff suppressed because one or more lines are too long