1var ScrollHitView = Backbone.View.extend({ 2 initialize: function(tag){ 3 this.$tag = $(tag); 4 this.$tag.removeClass('show'); 5 $(window).bind('resize', this.onResize.bind(this)); 6 this.onResize(); 7 $(window).bind('scroll', this.onScroll.bind(this)); 8 this.onScroll(); 9 }, 10 onResize: function() { 11 this.topPosition = this.$tag.offset().top; 12 this.height = this.$tag.height(); 13 this.windowHeight = $(window).height(); 14 }, 15 onScroll: function() { 16 var adjustement; 17 if ($(window).width() < 768) { 18 adjustement = 220; 19 } 20 else { 21 adjustement = $(window).height() / 2 - 180; 22 } 23 if ((this.topPosition - adjustement) < ($(window).scrollTop() + this.windowHeight / 2)) { 24 this.show(); 25 } 26 else { 27 this.hide(); 28 } 29 }, 30 show: function() { 31 this.$tag.addClass('show'); 32 }, 33 hide: function() { 34 this.$tag.removeClass('show'); 35 } 36});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.