Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Meteor.publish("amon", function() {
- return Mon.find({}, {
- sort: {
- utctime: -1
- },
- limit: 250
- })
- })
- $(window).scroll(function() {
- var livehistory = Session.get('livehistory')
- if (
- (document.getElementById('tabpage_1').style.display != "none") &&
- ($(document).height() - $(document).scrollTop() <= $(window).height() + 100) &&
- (livehistory < 2000)
- )
- {
- console.log("Scrolled Down");
- livehistory = livehistory + 200
- Session.set('livehistory', livehistory)
- }
- if ($(document).scrollTop() < $(window).height()*0.5) {
- // We're back to normal mode, so reduce displayed history and enable live mode.
- Session.set('livehistory', 80)
- Session.set('live', true)
- } else {
- Session.set('live', false)
- }
- });
- Template.log.loglines = function() {
- var query = Mon.find({}, {
- sort: {
- utctime: -1
- },
- limit: Session.get('livehistory'),
- reactive: Session.get("live") || false
- })
- return query
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement