diff options
| author | wjames5 <will@tekimaki.com> | 2007-10-31 03:28:43 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2007-10-31 03:28:43 +0000 |
| commit | 459d5a8371dafc803a9e8efa438e674364cdb5d7 (patch) | |
| tree | e5aeb41181363c4161b5990393bff3e3d6651078 /scripts | |
| parent | b58beca338042d0137437f38f5403f3a5649ff12 (diff) | |
| download | liberty-459d5a8371dafc803a9e8efa438e674364cdb5d7.tar.gz liberty-459d5a8371dafc803a9e8efa438e674364cdb5d7.tar.bz2 liberty-459d5a8371dafc803a9e8efa438e674364cdb5d7.zip | |
make ajax process check in attch uploader specific to attchment processes - general ajax request checks are too sweeping in scope, which can cause conflicts in other ajax requests that might not want the same exclusion. also tidy a libertyattachments ajax callback so its not running its process everytime its called on page load - which prolly should be cleaned up but not goign to bother tonight
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/LibertyAttachment.js | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/scripts/LibertyAttachment.js b/scripts/LibertyAttachment.js index d253ea9..941741e 100644 --- a/scripts/LibertyAttachment.js +++ b/scripts/LibertyAttachment.js @@ -5,8 +5,7 @@ LibertyAttachment = { "uploader": function(file, action, waitmsg, frmid) { if (LibertyAttachment.uploader_under_way) { alert(waitmsg); - } - else { + }else{ LibertyAttachment.uploader_under_way = 1; BitAjax.showSpinner(); var old_target = file.form.target; @@ -20,32 +19,34 @@ LibertyAttachment = { }, "uploaderComplete": function(frmid, divid, fileid) { - BitAjax.hideSpinner(); - var ifrm = document.getElementById(frmid); - if (ifrm.contentDocument) { - var d = ifrm.contentDocument; - } else if (ifrm.contentWindow) { - var d = ifrm.contentWindow.document; - } else { - var d = window.frames[frmid].document; - } - if (d.location.href == "about:blank") { - return; - } - var errMsg = "<div>Sorry, there was a problem retrieving results.</div>"; - var divO = document.getElementById(divid); - divR = d.getElementById('result_tab'); - if (divO != null) { - divO.innerHTML = (divR != null)?divR.innerHTML:errMsg+"a"; - } - divid = divid + '_tab'; - divO = document.getElementById(divid); - var divR = d.getElementById('result_list'); - if (divO != null) { - divO.innerHTML = (divR != null)?divR.innerHTML:errMsg+"b"; + if (LibertyAttachment.uploader_under_way){ + BitAjax.hideSpinner(); + var ifrm = document.getElementById(frmid); + if (ifrm.contentDocument) { + var d = ifrm.contentDocument; + } else if (ifrm.contentWindow) { + var d = ifrm.contentWindow.document; + } else { + var d = window.frames[frmid].document; + } + if (d.location.href == "about:blank") { + return; + } + var errMsg = "<div>Sorry, there was a problem retrieving results.</div>"; + var divO = document.getElementById(divid); + divR = d.getElementById('result_tab'); + if (divO != null) { + divO.innerHTML = (divR != null)?divR.innerHTML:errMsg+"a"; + } + divid = divid + '_tab'; + divO = document.getElementById(divid); + var divR = d.getElementById('result_list'); + if (divO != null) { + divO.innerHTML = (divR != null)?divR.innerHTML:errMsg+"b"; + } + LibertyAttachment.uploader_under_way = 0; + var file = document.getElementById(fileid); + file.value = ''; } - LibertyAttachment.uploader_under_way = 0; - var file = document.getElementById(fileid); - file.value = ''; } }
\ No newline at end of file |
