Skip to content

Commit

Permalink
Remove disabled navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Oct 16, 2014
1 parent a30d509 commit e809708
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions administrator/templates/isis/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,21 @@
<!-- End Status Module -->
<?php endif; ?>
<jdoc:include type="modules" name="debug" style="none" />
<?php if ($stickyToolbar) : ?>
<?php
// Get the singular view
$singular = preg_match('/&id=/', JURI::getInstance()->toString());
if ($stickyToolbar) : ?>
<script>
(function($)
{
// fix sub nav on scroll
var $win = $(window)
, $nav = $('.subhead')
, navTop = $('.subhead').length && $('.subhead').offset().top - <?php if ($displayHeader || !$statusFixed) : ?>40<?php else:?>20<?php endif;?>
, navTop = $('.subhead').length && $('.subhead').offset().top -50
, isFixed = 0
, edit = <?php echo $singular; ?>

processScroll()
processScroll()

// hack sad times - holdover until rewrite for 2.1
$nav.on('click', function()
Expand All @@ -280,6 +284,13 @@
}
})

// remove disabled nav
if (edit)
{
$('.navbar-fixed-top').addClass('hidden');
$('body').animate({ paddingTop: 0 });
}

$win.on('scroll', processScroll)

function processScroll()
Expand All @@ -288,6 +299,11 @@ function processScroll()
if (scrollTop >= navTop && !isFixed) {
isFixed = 1
$nav.addClass('subhead-fixed')
// remove disabled nav
if (edit)
{
$('.subhead-fixed').css("top", "0");
}
} else if (scrollTop <= navTop && isFixed) {
isFixed = 0
$nav.removeClass('subhead-fixed')
Expand Down

0 comments on commit e809708

Please sign in to comment.