1
0
Fork 0

Create Profile\Attachment\Upload module class

- Add missing response type in AjaxUpload initializition
This commit is contained in:
Hypolite Petovan 2022-10-30 13:36:08 -04:00
commit 969b4f991e
5 changed files with 185 additions and 13 deletions

View file

@ -203,8 +203,9 @@ var FileBrowser = {
if ($("#upload-file").length) {
//AjaxUpload for files
var file_uploader = new window.AjaxUpload("upload-file", {
action: "wall_attach/" + FileBrowser.nickname + "?response=json",
action: "profile/" + FileBrowser.nickname + "/attachment/upload?response=json",
name: "userfile",
responseType: "json",
onSubmit: function (file, ext) {
$(".fbrowser-content").hide();
$(".fbrowser .profile-rotator-wrapper").show();
@ -214,7 +215,7 @@ var FileBrowser = {
if (response["error"] != undefined) {
$(".error span").html(response["error"]);
$(".error").removeClass("hidden");
$("#profile-rotator").hide();
$(".fbrowser .profile-rotator-wrapper").hide();
$(".fbrowser-content").show();
return;
}

View file

@ -75,7 +75,7 @@ function enableOnUser(){
var file_uploader = new window.AjaxUpload(
'wall-file-upload',
{ action: 'wall_attach/{{$nickname}}',
{ action: 'profile/{{$nickname}}/attachment/upload',
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {