forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAK-29383 - Fix view for site tabs when user has multiple sites to di…
…splay
- Loading branch information
Showing
7 changed files
with
89 additions
and
712 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
portal/portal-render-engine-impl/pack/src/webapp/vm/morpheus/includeSitesNav.vm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
reference/library/src/morpheus-master/js/src/sakai.linknav.sites.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
If there's too many sites on siteNav for sreen size we should organize them a little. | ||
*/ | ||
var setupLinkNav = function(){ | ||
var linknav = document.getElementById('Mrphs-sites-nav'); // need real DOM Node, not jQuery wrapper | ||
|
||
var h = $PBJQ("#Mrphs-sites-nav ul").height(); | ||
var howManyHidden = 0; | ||
|
||
$PBJQ(".Mrphs-sitesNav__menuitem", "#linkNav").each(function(){ | ||
if ( $PBJQ(this).position().top > h){ howManyHidden++ } | ||
}); | ||
|
||
if( howManyHidden !== 0 ){ | ||
$PBJQ('#linkNav').addClass( 'scrolled-sites' ); | ||
$PBJQ('#how-many-hidden').text( howManyHidden ); | ||
}else{ | ||
$PBJQ('#linkNav').removeClass( 'scrolled-sites' ); | ||
} | ||
}; | ||
|
||
$PBJQ(document).ready(function(){ | ||
setupLinkNav(); | ||
$PBJQ('#show-all-sites').on('click', function(){ | ||
$PBJQ('#linkNav').toggleClass('opened'); | ||
$PBJQ(this).toggleClass('opened'); | ||
}); | ||
$( window ).resize(function() { | ||
setupLinkNav(); | ||
}); | ||
}); |
Oops, something went wrong.