Skip to content

Commit

Permalink
Optimized archived Web page plugin loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Oct 24, 2012
1 parent 5e6289f commit c1da4e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/js/pe-ap-min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/js/workers/archived.js
Expand Up @@ -18,7 +18,8 @@
}
// create the toolbar
var notice = $('<div class="archived" role="toolbar"><a class="archived-top-page" href="#archived" role="link">' + pe.dic.get('%archived-page') + '</a></div>'),
$window = $(window);
$window = $(window),
scrollTop = $window.scrollTop();
// lets bind the scrolls
$window.on('scroll', function () {
if ($(this).scrollTop() > 10) {
Expand All @@ -37,17 +38,16 @@
});

// now test to ensure that we have this correctly placed
if ($window.scrollTop() < 10 || $window.scrollTop() === 'undefined') {
notice.fadeOut('normal').attr('aria-hidden', 'true');
if (scrollTop < 10 || scrollTop === 'undefined') {
notice.attr('aria-hidden', 'true');
} else {
notice.fadeIn('normal').attr('aria-hidden', 'false');
}
// add to page
pe.pagecontainer().append(notice);

return elm;
} // end of exec
};
window.pe = _pe;
return _pe;
}(jQuery));
}(jQuery));

0 comments on commit c1da4e7

Please sign in to comment.