Mercurial > hg > fapweb
changeset 860:bb4a6967ccdd
Keep edit state after file upload in updateEntry().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 26 Nov 2014 10:30:39 +0200 |
parents | 16cbfb3e7cd4 |
children | 62b3a69e9030 |
files | admajax.php admin.js ajax.js |
diffstat | 3 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/admajax.php Wed Nov 26 10:29:54 2014 +0200 +++ b/admajax.php Wed Nov 26 10:30:39 2014 +0200 @@ -202,7 +202,7 @@ " <input type=\"file\" name=\"".$type."ToUpload".$eid."\" id=\"".$type."ToUpload".$eid."\">\n". " ".stGetFormButtonInput($type."UploadButton", $eid, "", "Upload", "jsStartFileUpload('".$type."UploadForm".$eid."','".$handler."','".$type."ToUpload".$eid. - "',".stGetSetting($type."MaxSize").", 'updateEntry(".$entry["compo_id"].",".$eid.")')")."\n". + "',".stGetSetting($type."MaxSize").", 'updateEntry(".$entry["compo_id"].",".$eid.", 1)')")."\n". " </form>\n"; } @@ -328,7 +328,7 @@ { case EEMODE_EDIT: echo - stGetFormButtonInput("update", $eid, $prefix, "Update", "updateEntry(".$item["compo_id"].",".$eid.")"). + stGetFormButtonInput("update", $eid, $prefix, "Update", "updateEntry(".$item["compo_id"].",".$eid.", 0)"). stGetFormButtonInput("delete", $eid, $prefix, "Delete", "deleteEntry(".$item["compo_id"].",".$eid.")"); break;
--- a/admin.js Wed Nov 26 10:29:54 2014 +0200 +++ b/admin.js Wed Nov 26 10:30:39 2014 +0200 @@ -445,7 +445,7 @@ } -function updateEntry(cid, id) +function updateEntry(cid, id, edit) { var args = jsMakePostArgs({"name":1, "author":1, "filename":1, "info":1, "notes":1, "compo_id":4, "evalue":2}, "en", id, true); var has_id = "compo_id" in lastPostArgs; @@ -471,7 +471,7 @@ var mcb_ok = function(data) { - jsSendPOSTRequest("action=update&type=entry&id="+id+"&"+args, msuccess); + jsSendPOSTRequest("action=update&type=entry&id="+id+"&edit="+edit+"&"+args, msuccess); } var mcb_cancel = function(data)
--- a/ajax.js Wed Nov 26 10:29:54 2014 +0200 +++ b/ajax.js Wed Nov 26 10:30:39 2014 +0200 @@ -290,6 +290,8 @@ req.upload.addEventListener('progress', jsUploadProgress, false); req.addEventListener('load', function(e) { + if (fileCallback) + setTimeout(fileCallback); }, false); req.addEventListener('error', jsUploadError, false);