Parcourir la source

Merge pull request #4291 from saurabh6790/upload_attendance_fix

[fix] missing dataurl in on_attach
version-14
Saurabh il y a 7 ans
committed by GitHub
Parent
révision
b3ee2d56fc
2 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. +1
    -0
      frappe/public/js/frappe/form/grid.js
  2. +3
    -3
      frappe/public/js/frappe/upload.js

+ 1
- 0
frappe/public/js/frappe/form/grid.js Voir le fichier

@@ -561,6 +561,7 @@ frappe.ui.form.Grid = Class.extend({
me.setup_download();

// upload
frappe.flags.no_socketio = true;
$(this.wrapper).find(".grid-upload").removeClass("hide").on("click", function() {
frappe.prompt({fieldtype:"Attach", label:"Upload File"},
function(data) {


+ 3
- 3
frappe/public/js/frappe/upload.js Voir le fichier

@@ -239,12 +239,12 @@ frappe.upload = {
}
},

_upload_file: function(fileobj, args, opts) {
_upload_file: function(fileobj, args, opts, dataurl) {
if (args.file_size) {
frappe.upload.validate_max_file_size(args.file_size);
}
if(opts.on_attach) {
opts.on_attach(args)
opts.on_attach(args, dataurl)
} else {
if (opts.confirm_is_private) {
frappe.prompt({
@@ -291,7 +291,7 @@ frappe.upload = {
freader.readAsDataURL(fileobj);
}

if (opts.no_socketio) {
if (opts.no_socketio || frappe.flags.no_socketio) {
upload_with_filedata();
return;
}


Chargement…
Annuler
Enregistrer