<commit_before>'use strict';
var $ = require('jquery');

var pointers = require('js/pointers');
var AccountClaimer = require('js/accountClaimer.js');
var $osf = require('js/osfHelpers');

// NodeActions is needed for rendering recent logs in nodelists (e.g. regsitrations and forks
// pages
require('js/project');

require('js/registerNode');

var node = window.contextVars.node;


new pointers.PointerDisplay('#showLinks');

if (!window.contextVars.currentUser.isContributor) {
    new AccountClaimer('.contributor-unregistered');
}

if (node.isPublic && node.piwikSiteID) {
    $osf.trackPiwik(node.piwikHost, node.piwikSiteID);
}

// Used for clearing backward/forward cache issues
$(window).unload(function(){
    return 'Unload';
});
$(document).ready(function() {
    $.getJSON(node.urls.api, function(data) {    
        $('body').trigger('nodeLoad', data);
    });

    var target = 50, smallScreenSize = 767,
    timeout = null;
    var checkPanelPosition = function() {
        var bodyWidth = $(document.body).width();
        if (bodyWidth <= smallScreenSize) {
            if ($(window).scrollTop() >= target) {
                $('.cp-handle').css('margin-top', 50);
            }
            else {
                $('.cp-handle').css('margin-top', 95);
            }
        }
    };

    checkPanelPosition(); /* Init when refreshing the page*/
    $(window).scroll(function () {
        if (!timeout) {
            timeout = setTimeout(function () {
                clearTimeout(timeout);
                timeout = null;
                checkPanelPosition();
            }, 80);
        }
    });

    $( window ).resize(function() {
        var bodyWidth = $(document.body).width();
        if (bodyWidth > smallScreenSize || $(window).scrollTop() < target) {
            $('.cp-handle').css('margin-top', 95);
        }
    });
});<commit_msg>make comment panel icon top when resizing from big to small<commit_after>'use strict';
var $ = require('jquery');

var pointers = require('js/pointers');
var AccountClaimer = require('js/accountClaimer.js');
var $osf = require('js/osfHelpers');

// NodeActions is needed for rendering recent logs in nodelists (e.g. regsitrations and forks
// pages
require('js/project');

require('js/registerNode');

var node = window.contextVars.node;


new pointers.PointerDisplay('#showLinks');

if (!window.contextVars.currentUser.isContributor) {
    new AccountClaimer('.contributor-unregistered');
}

if (node.isPublic && node.piwikSiteID) {
    $osf.trackPiwik(node.piwikHost, node.piwikSiteID);
}

// Used for clearing backward/forward cache issues
$(window).unload(function(){
    return 'Unload';
});
$(document).ready(function() {
    $.getJSON(node.urls.api, function(data) {    
        $('body').trigger('nodeLoad', data);
    });

    var target = 50, smallScreenSize = 767,
    timeout = null;
    var checkPanelPosition = function() {
        var bodyWidth = $(document.body).width();
        if (bodyWidth <= smallScreenSize) {
            if ($(window).scrollTop() >= target) {
                $('.cp-handle').css('margin-top', 50);
            }
            else {
                $('.cp-handle').css('margin-top', 95);
            }
        }
    };

    checkPanelPosition(); /* Init when refreshing the page*/
    $(window).scroll(function () {
        if (!timeout) {
            timeout = setTimeout(function () {
                clearTimeout(timeout);
                timeout = null;
                checkPanelPosition();
            }, 80);
        }
    });

    $( window ).resize(function() {
        var bodyWidth = $(document.body).width();
        if (bodyWidth > smallScreenSize || $(window).scrollTop() < target) {
            $('.cp-handle').css('margin-top', 95);
        } else if (bodyWidth < smallScreenSize || $(window).scrollTop() > target) {
            $('.cp-handle').css('margin-top', 50);
        }
    });
});
{'fraction_non_alphanumeric': 0.16568501920614598, 'fraction_numerical': 0.007170294494238156, 'mean_word_length': 2.5476839237057223, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5890955', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1116, 'n_words': 236}