Index: lams_central/web/includes/javascript/doc-popover.js =================================================================== diff -u -r4823ade4f0ee496c52259db12b4dd7d53245bf86 -rc911e2db50e914ea8a7b2740d02d53522eff6c15 --- lams_central/web/includes/javascript/doc-popover.js (.../doc-popover.js) (revision 4823ade4f0ee496c52259db12b4dd7d53245bf86) +++ lams_central/web/includes/javascript/doc-popover.js (.../doc-popover.js) (revision c911e2db50e914ea8a7b2740d02d53522eff6c15) @@ -1,66 +1,80 @@ $(document).ready(function() { - $('[data-toggle="doc-popover"]').popover({ - 'html' : true, - 'container' : 'body', - 'title' : function(){ - // first try to get the title straight from element attributes - let popover = $(this), - title = popover.data('title'); - if (title) { - return title; - } - // if no title is present in attributes then see if the element is using attributes for content - // if so and no data-title was provided, it means that no title is needed - if (popover.data('content')) { - return ""; - } - - // next attempt: try to find a sibling that contains the content - let content = popover.siblings('.doc-popover-content'); - if (content.length === 0) { - // no sibling found, so try to find the content using ID - let popoverId = popover.attr('id'); - if (!popoverId) { + $('[data-toggle="doc-popover"]') + .attr({ + "aria-expanded" : "false", + "aria-haspopup" : "true", + "tabindex" : "0", + "role" : "button" + }) + .on('keypress', function(e){ + if (e.keyCode === 32 || e.keyCode == 13) { + // check for Space or Enter key + $(this).trigger('click'); + return false; + } + }) + .popover({ + 'html' : true, + 'container' : 'body', + 'trigger' : 'click', + 'title' : function(){ + // first try to get the title straight from element attributes + let popover = $(this), + title = popover.data('title'); + if (title) { + return title; + } + // if no title is present in attributes then see if the element is using attributes for content + // if so and no data-title was provided, it means that no title is needed + if (popover.data('content')) { return ""; } - content = $('#' + popoverId + '-content'); + + // next attempt: try to find a sibling that contains the content + let content = popover.siblings('.doc-popover-content'); if (content.length === 0) { - return ""; + // no sibling found, so try to find the content using ID + let popoverId = popover.attr('id'); + if (!popoverId) { + return ""; + } + content = $('#' + popoverId + '-content'); + if (content.length === 0) { + return ""; + } } - } - // if content found then try to extract title from it, if any - title = content.children('.doc-popover-title'); - return title.length === 0 ? "" : title.html(); - }, - 'content' : function(){ - // first try to get content straight from element attributes - let popover = $(this), - content = popover.data('content'); - if (content) { - return content; - } - - // next attempt: try to find a sibling that contains the content - content = popover.siblings('.doc-popover-content'); - if (content.length === 0) { - // no sibling found, so try to find the content using ID - let popoverId = popover.attr('id'); - if (!popoverId) { - return ""; + // if content found then try to extract title from it, if any + title = content.children('.doc-popover-title'); + return title.length === 0 ? "" : title.html(); + }, + 'content' : function(){ + // first try to get content straight from element attributes + let popover = $(this), + content = popover.data('content'); + if (content) { + return content; } - content = $('#' + popoverId + '-content'); + + // next attempt: try to find a sibling that contains the content + content = popover.siblings('.doc-popover-content'); if (content.length === 0) { - return ""; + // no sibling found, so try to find the content using ID + let popoverId = popover.attr('id'); + if (!popoverId) { + return ""; + } + content = $('#' + popoverId + '-content'); + if (content.length === 0) { + return ""; + } } + + // if content found then try to extract body from it + let contentBody = content.children('.doc-popover-body'); + return contentBody.length === 0 ? "" : contentBody.html(); } + }); - // if content found then try to extract body from it - let contentBody = content.children('.doc-popover-body'); - return contentBody.length === 0 ? "" : contentBody.html(); - } - }); - - // Dismiss popover on a click outside an open popover // Taken from https://stackoverflow.com/a/33953365 $(document).on('click', function (e) { Index: lams_tool_assessment/web/pages/monitoring/statisticpart.jsp =================================================================== diff -u -rdd231e904390e128d0708625fb9cd27f7f02190d -rc911e2db50e914ea8a7b2740d02d53522eff6c15 --- lams_tool_assessment/web/pages/monitoring/statisticpart.jsp (.../statisticpart.jsp) (revision dd231e904390e128d0708625fb9cd27f7f02190d) +++ lams_tool_assessment/web/pages/monitoring/statisticpart.jsp (.../statisticpart.jsp) (revision c911e2db50e914ea8a7b2740d02d53522eff6c15) @@ -309,14 +309,14 @@ - + @@ -336,21 +336,21 @@   - +   - +   - @@ -401,7 +401,7 @@ - Here is a link + Here is a link