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:
@@ -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
Reference in New Issue
Block a user