mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-10 05:26:06 +00:00
drag&drop handler can call function after upload
This commit is contained in:
parent
db3fcbaaab
commit
fdc7aa5ab7
|
@ -822,6 +822,15 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
target_type = droptarget.split("_")[0];
|
target_type = droptarget.split("_")[0];
|
||||||
target_id = droptarget.split("_")[1];
|
target_id = droptarget.split("_")[1];
|
||||||
}
|
}
|
||||||
|
var afterupload = obj.data('afterupload');
|
||||||
|
if(afterupload) {
|
||||||
|
afteruploadfunc = eval(afterupload);
|
||||||
|
} else {
|
||||||
|
afteruploadfunc = function() {
|
||||||
|
if(target_id == seeddms_folder)
|
||||||
|
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder});
|
||||||
|
}
|
||||||
|
}
|
||||||
if(target_type == 'folder' && target_id) {
|
if(target_type == 'folder' && target_id) {
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
if(files[i].size <= maxFileSize) {
|
if(files[i].size <= maxFileSize) {
|
||||||
|
@ -844,10 +853,7 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
statusbar.parent().show();
|
statusbar.parent().show();
|
||||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||||
status.setFileNameSize(files[i].name,files[i].size);
|
status.setFileNameSize(files[i].name,files[i].size);
|
||||||
SeedDMSUpload.sendFileToServer(fd,status,function(){
|
SeedDMSUpload.sendFileToServer(fd,status,afteruploadfunc);
|
||||||
if(target_id == seeddms_folder)
|
|
||||||
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder});
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
noty({
|
noty({
|
||||||
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
||||||
|
|
|
@ -853,6 +853,15 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
target_type = droptarget.split("_")[0];
|
target_type = droptarget.split("_")[0];
|
||||||
target_id = droptarget.split("_")[1];
|
target_id = droptarget.split("_")[1];
|
||||||
}
|
}
|
||||||
|
var afterupload = obj.data('afterupload');
|
||||||
|
if(afterupload) {
|
||||||
|
afteruploadfunc = eval(afterupload);
|
||||||
|
} else {
|
||||||
|
afteruploadfunc = function() {
|
||||||
|
if(target_id == seeddms_folder)
|
||||||
|
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder});
|
||||||
|
}
|
||||||
|
}
|
||||||
if(target_type == 'folder' && target_id) {
|
if(target_type == 'folder' && target_id) {
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
if(files[i].size <= maxFileSize) {
|
if(files[i].size <= maxFileSize) {
|
||||||
|
@ -875,10 +884,7 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
statusbar.parent().show();
|
statusbar.parent().show();
|
||||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||||
status.setFileNameSize(files[i].name,files[i].size);
|
status.setFileNameSize(files[i].name,files[i].size);
|
||||||
SeedDMSUpload.sendFileToServer(fd,status,function(){
|
SeedDMSUpload.sendFileToServer(fd,status,afteruploadfunc);
|
||||||
if(target_id == seeddms_folder)
|
|
||||||
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder});
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
noty({
|
noty({
|
||||||
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user