From 5b17e21ec228e4783e378cbe2a9e87e8f2c69530 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Thu, 20 Dec 2018 19:54:08 +0100 Subject: [PATCH] More UX testing --- Site/Pages/v5/Ledgers/EndOfMonth.aspx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Site/Pages/v5/Ledgers/EndOfMonth.aspx b/Site/Pages/v5/Ledgers/EndOfMonth.aspx index 930a90af..1cb38155 100644 --- a/Site/Pages/v5/Ledgers/EndOfMonth.aspx +++ b/Site/Pages/v5/Ledgers/EndOfMonth.aspx @@ -210,6 +210,30 @@ }); + function markItemCompleted(item) { + + var groupId = $(item).attr('data-group'); + var itemId = $(item).attr('data-item'); + + $('span.action-list-item[data-item="' + itemId + '"]').addClass('action-list-item-completed'); + $('img.status-icon-pleasewait[data-item="' + itemId + '"]').hide(); + $('img.status-icon-completed[data-item="' + itemId + '"]').fadeIn(); + + var selector = ".action-list-item:not(.action-list-item-completed):not(.action-list-item-disabled)[data-group='" + groupId + "']"; + if ($(selector).length == 0) // no further actions in this group enabled + { + // mark the group as completed + $(".group-status-icon[data-group='" + groupId + "']").fadeIn(); + } + + // If any items depended on this one, enable them now + + var dependentItemId = $('span.action-list-item[data-dependson="' + itemId + '"]').attr("data-item"); + $('span.action-list-item[data-item="' + dependentItemId + '"]').removeClass('action-list-item-disabled'); + $('img.action-icon[data-item="' + dependentItemId + '"]').removeClass('action-icon-disabled'); + + } + function clientStartedUpload() { console.log("Client started upload"); @@ -237,6 +261,8 @@ return; } + markItemCompleted(activeUpload); + var itemId = $(activeUpload).attr('data-item'); $('img.status-icon-pleasewait[data-item="' + itemId + '"]').hide(); $('img.action-icon[data-item="' + itemId + '"]').show();