Skip to content

Commit

Permalink
SAK-41586 Allow gradebook to go fullscreen (sakaiproject#7341)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish authored Sep 11, 2019
1 parent db55dff commit fcc0865
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 214 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<wicket:message key="label.toolbar.togglehelp"/>
</span>
</a>
<sakai-maximise-button></sakai-maximise-button>
</div>
</div>

Expand Down
11 changes: 10 additions & 1 deletion gradebookng/tool/src/webapp/styles/gradebook-grades.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
line-height: 1em;
max-width: 80%;
max-width: calc(100% - 50px);
margin-top: 10px;
font-size: 12px;
}
#gradebookGradesToolbar .gb-item-summary.warn-items-hidden .gb-item-summary-counts {
Expand Down Expand Up @@ -641,6 +640,11 @@ div.wicket-modal div.w_right > div {
margin-left: auto;
}

.captionToggleContainer {
display: flex;
align-items: center;
}

.gradesToolbar2
{
-ms-grid-row: 2;
Expand Down Expand Up @@ -736,3 +740,8 @@ div.wicket-mask-transparent, div.wicket-mask-dark {
width: 100%;
margin-bottom: 15px;
}

sakai-maximise-button {
padding-top: 5px;
margin-left: 10px;
}
45 changes: 42 additions & 3 deletions library/src/morpheus-master/js/src/sakai.morpheus.usernav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

function userNavEscHandler(e){

if (e.keyCode === 27) { // esc keycode
toggleUserNav(e);
}
Expand All @@ -12,8 +13,10 @@ function userNavEscHandler(e){
* Toggle user nav in header:
*/

function toggleUserNav(event){
function toggleUserNav(event) {

event.preventDefault();

$PBJQ('.Mrphs-userNav__subnav').toggleClass('is-hidden');

if (!$PBJQ('.Mrphs-userNav__subnav').hasClass('is-hidden')) {
Expand All @@ -25,7 +28,7 @@ function toggleUserNav(event){
$PBJQ('body').prepend(overlay);

// ESC key also closes it
$PBJQ(document).on('keyup',userNavEscHandler);
$PBJQ(document).on('keyup.usernav',userNavEscHandler);

} else {
$PBJQ('.user-dropdown-overlay').remove();
Expand Down Expand Up @@ -285,11 +288,47 @@ $PBJQ(document).ready( function(){

currentHeaderWidth = $PBJQ(".Mrphs-mainHeader").width();


$PBJQ('.Mrphs-headerLogo').on('click', function() {
// scroll to top on banner click/touch
document.body.scrollTop = 0;
document.body.scrollLeft = 0;
$PBJQ(window).trigger('scroll');
});

var minimiseTool = () => {

$PBJQ(document).off("keypress.maximise");

$PBJQ(".Mrphs-topHeader").show();
$PBJQ("#Mrphs-sites-nav").show();
$PBJQ(".Mrphs-siteHierarchy").show();
$PBJQ("#toolMenuWrap").show();
$PBJQ("#footer").show();
$PBJQ("#presenceToggle").show();
};

$PBJQ("body").on("maximise-tool", e => {

$PBJQ(document).off('keyup.usernav');

$PBJQ(".Mrphs-topHeader").hide();
$PBJQ("#Mrphs-sites-nav").hide();
$PBJQ(".Mrphs-siteHierarchy").hide();
$PBJQ("#toolMenuWrap").hide();
$PBJQ("#footer").hide();
$PBJQ("#presenceToggle").hide();

$PBJQ(document).on("keyup.maximise", e => {

// Exit fullscreen mode on escape
if (e.keyCode === 27) {
minimiseTool();
e.stopPropagation();
$PBJQ(document).on('keyup.usernav',userNavEscHandler);
$PBJQ("sakai-maximise-button").each((i ,e) => e.setMinimised());
}
});
});

$PBJQ("body").on("minimise-tool", e => minimiseTool());
});
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@

<script type="module" src="/webcomponents/sakai-tool-permissions.js$!{portalCDNQuery}"></script>
<script type="module" src="/webcomponents/sakai-search.js$!{portalCDNQuery}"></script>
<script type="module" src="/webcomponents/sakai-maximise-button.js$!{portalCDNQuery}"></script>

<!-- RUBRICS CODE AND MODULES -->
<script type="module" src="/rubrics-service/webcomponents/sakai-rubric-student.js$!{portalCDNQuery}"></script>
Expand Down
210 changes: 0 additions & 210 deletions webcomponents/bundle/src/main/bundle/.properties

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
normal_view=Normal View
fullscreen_view=Fullscreen View
Loading

0 comments on commit fcc0865

Please sign in to comment.