<commit_before>define(
  [
    'views/ListFilterView',
    'util/FlightPolyline'
  ],
  function (ListFilterView,FlightPolyline) {
    'use strict';

    return Backbone.View.extend(
      {
        el: '#home-list',
        events: {
          'click li.has-link': 'onClickLi'
        },
        initialize: function (options) {
          if (this.$el.length) {

            this.initFilters();

            _.bindAll(this, 'updateMap');
            this.sideMapView = options.sideMapView;
            this.sideMapView.initMap({preventZoom:true});

            this.sideMapView.on('mapSized', this.updateMap);
            $(document).bind('scroll', _.throttle(this.updateMap, 400, {leading: false}));
            $(document).trigger('scroll');
          }
        },
        updateMap: function(event) {
          var lis = this.$('>li').removeClass('is-in-view');
          if (lis.length) {
            var w = $(window);
            var scrollTop = w.scrollTop(); // window.scrollY?
            var viewportHeight = w.height();
            lis.each(function(i, li) {
              var $li = $(li);
              var top = $li.position().top;
              var h = $li.height();
              if (top + h < scrollTop || $li.is('#now-marker')) {
                return true;
              } else if (top > scrollTop + viewportHeight) {
                return false;
              }
              $li.addClass('is-in-view');
            });
            var stripSpace = /[\t|\n]/g;
            var markers = this.$('>li.is-in-view').map(function() {
              var $li = $(this);
              var domData = $li.data();
              if (!domData.marker) {
                var icon = $li.find('>.nif-icon').attr('class').split(' ')[1];
                var title = $li.find('h1').text().replace(stripSpace, '');
                var marker;
                var link;
                switch (icon) {
                  case 'nif-icon-plane':
                    marker = new FlightPolyline({airports: $li.find('.list-page-map').data().airports, noPlaneMarkers: true});
                    break;
                  case 'nif-icon-book':
                  case 'nif-icon-info-circle':
                  case 'nif-icon-camera-retro':<commit_msg>Fixing the side map so it works with the new boarding passes...<commit_after>define(
  [
    'views/ListFilterView',
    'util/FlightPolyline'
  ],
  function (ListFilterView,FlightPolyline) {
    'use strict';

    return Backbone.View.extend(
      {
        el: '#home-list',
        events: {
          'click li.has-link': 'onClickLi'
        },
        initialize: function (options) {
          if (this.$el.length) {

            this.initFilters();

            _.bindAll(this, 'updateMap');
            this.sideMapView = options.sideMapView;
            this.sideMapView.initMap({preventZoom:true});

            this.sideMapView.on('mapSized', this.updateMap);
            $(document).bind('scroll', _.throttle(this.updateMap, 400, {leading: false}));
            $(document).trigger('scroll');
          }
        },
        updateMap: function(event) {
          var lis = this.$('>li').removeClass('is-in-view');
          if (lis.length) {
            var w = $(window);
            var scrollTop = w.scrollTop(); // window.scrollY?
            var viewportHeight = w.height();
            lis.each(function(i, li) {
              var $li = $(li);
              var top = $li.position().top;
              var h = $li.height();
              if (top + h < scrollTop || $li.is('#now-marker')) {
                return true;
              } else if (top > scrollTop + viewportHeight) {
                return false;
              }
              $li.addClass('is-in-view');
            });
            var stripSpace = /[\t|\n]/g;
            var markers = this.$('>li.is-in-view').map(function() {
              var $li = $(this);
              var domData = $li.data();
              if (!domData.marker) {
                var icon = $li.find('>.nif-icon');
                if (icon.length) {
                  icon = icon.attr('class').split(' ')[1];
                } else {
                  icon = 'nif-icon-plane';
                }
                var title = $li.find('h1').text().replace(stripSpace, '');
                var marker;
                var link;
                switch (icon) {
                  case 'nif-icon-plane':
                    marker = new FlightPolyline({airports: $li.find('.boarding-pass').data().airports, noPlaneMarkers: true});
                    break;
                  case 'nif-icon-book':
                  case 'nif-icon-info-circle':
                  case 'nif-icon-camera-retro':
{'fraction_non_alphanumeric': 0.15343576611182244, 'fraction_numerical': 0.002134016218523261, 'mean_word_length': 1.4513598326359833, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '942716', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1318, 'n_words': 255}