Bug Fix: Upload attachments required refresh

This commit is contained in:
Gary Sharp
2013-11-12 12:21:35 +11:00
parent 9ac487e7e0
commit b1048588e7
6 changed files with 306 additions and 245 deletions
@@ -120,12 +120,17 @@
if (d.Result == 'OK') {
var a = d.Attachment;
@if (canRemoveAnyAttachments)
{<text>buildAttachment(a, true);</text>}
{
<text>buildAttachment(a, true, quick);</text>
}
else if (canRemoveOwnAttachments)
{<text>buildAttachment(a, (a.AuthorId === '@(CurrentUser.Id)'));</text>}
{
<text>buildAttachment(a, (a.AuthorId === '@(CurrentUser.Id)'), quick);</text>
}
else
{<text>buildAttachment(a, false);</text>}
{
<text>buildAttachment(a, false, quick);</text>
}
} else {
alert('Unable to add attachment: ' + d.Result);
}
@@ -136,7 +141,7 @@
});
}
function buildAttachment(a, canRemove) {
function buildAttachment(a, canRemove, quick) {
var t = '<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span>';
if (canRemove)
t += '<span class="remove"></span>';