<commit_before>import Ember from 'ember';

export default Ember.Component.extend({
    style: Ember.computed('layer.settings.values.color', function(){
        return Ember.String.htmlSafe('color: ' + (this.get('layer.settings.values.color') || '#333') + '; ');
    }),
    sticky: Ember.observer('layer.settings.values.StickToTop' , function() {
        let topOfNav = $('.pages-menu').offset().top;
        if(this.get('layer.settings.values.StickToTop')){
            $(window).on('scroll', function (e) { 
                if ( $(window).scrollTop() >= topOfNav ) {
                    $('.pages-menu').addClass('sticky-nav')
                }else{
                    $('.pages-menu').removeClass('sticky-nav')
                } 
            });
        }else{
           $(window).off('scroll');
        }
   }),
    actions: {
        scrollToLayer(index){
            let el = $('#layer'+index);
            let offset = el.offset();
            $('body').animate({scrollTop:offset.top}, '500');
        }
    }
});
<commit_msg>Add namespace for scrolling event<commit_after>import Ember from 'ember';

export default Ember.Component.extend({
    style: Ember.computed('layer.settings.values.color', function(){
        return Ember.String.htmlSafe('color: ' + (this.get('layer.settings.values.color') || '#333') + '; ');
    }),
    sticky: Ember.observer('layer.settings.values.StickToTop' , function() {
        let topOfNav = $('.pages-menu').offset().top;
        if(this.get('layer.settings.values.StickToTop')){
            $(window).on('scroll.nav', function (e) { 
                if ( $(window).scrollTop() >= topOfNav ) {
                    $('.pages-menu').addClass('sticky-nav')
                }else{
                    $('.pages-menu').removeClass('sticky-nav')
                } 
            });
        }else{
           $(window).off('scroll.nav');
        }
   }),
    actions: {
        scrollToLayer(index){
            let el = $('#layer'+index);
            let offset = el.offset();
            $('body').animate({scrollTop:offset.top}, '500');
        }
    }
});

{'fraction_non_alphanumeric': 0.18970448045757865, 'fraction_numerical': 0.005719733079122974, 'mean_word_length': 2.0028612303290414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6329567', 'n_tokens_mistral': 632, 'n_tokens_neox': 604, 'n_words': 88}