<commit_before>define(['backbone.marionette', 'js/device', 'js/commands', 'hbs!js/views/dashboard/templates/header'],

function (Marionette, device, commands, template) {
  "use strict";

  return Marionette.ItemView.extend({

    template: template,

    ui: {
      blognameArrow: '#blogname-arrow'
    },

    initialize: function (options) {
      this.blog = options.blog;
    },

    handleSlide: function () {
      var $blognameArrow = this.ui.blognameArrow;
      if ($blognameArrow.hasClass('rotate')) {
        $(document.body).toggleClass('hide');
        commands.execute('menu:hide');
        commands.execute('dashboard:slideup');
        commands.execute('menu:header:toggle');
        $blognameArrow.toggleClass('rotate');
      } else {
        $(document.body).toggleClass('hide');
        commands.execute('menu:show');
        commands.execute('dashboard:slidedown', this.$el.height());
        commands.execute('menu:header:toggle');
        $blognameArrow.toggleClass('rotate');
      }
    },

    adjustHeader: function () {
      var $blognameInner = this.$el.find('#blogname-inner');
      var $loupeCircle = this.$el.find('#blogname-circle');
      var $blognameArrow = this.ui.blognameArrow;
      var offset = $blognameInner.offset();
      var width = $blognameInner.width();
      $loupeCircle.offset({
        left: offset.left - $loupeCircle.outerWidth(true)
      })
        .css({
        display: 'block'
      });
      $blognameArrow.offset({
        left: offset.left + width
      })
        .css({
        display: 'block'
      });<commit_msg>avoid stopping loading the entire screen when some elements could not be found<commit_after>define(['backbone.marionette', 'js/device', 'js/commands', 'hbs!js/views/dashboard/templates/header'],

function (Marionette, device, commands, template) {
  "use strict";

  return Marionette.ItemView.extend({

    template: template,

    ui: {
      blognameArrow: '#blogname-arrow'
    },

    initialize: function (options) {
      this.blog = options.blog;
    },

    handleSlide: function () {
      var $blognameArrow = this.ui.blognameArrow;
      if ($blognameArrow.hasClass('rotate')) {
        $(document.body).toggleClass('hide');
        commands.execute('menu:hide');
        commands.execute('dashboard:slideup');
        commands.execute('menu:header:toggle');
        $blognameArrow.toggleClass('rotate');
      } else {
        $(document.body).toggleClass('hide');
        commands.execute('menu:show');
        commands.execute('dashboard:slidedown', this.$el.height());
        commands.execute('menu:header:toggle');
        $blognameArrow.toggleClass('rotate');
      }
    },

    adjustHeader: function () {
      var $blognameInner = this.$el.find('#blogname-inner');
      var $loupeCircle = this.$el.find('#blogname-circle');
      var $blognameArrow = this.ui.blognameArrow;
      if ($blognameInner) {
        var offset = $blognameInner.offset();
        var width = $blognameInner.width();
        if ($loupeCircle) {
          $loupeCircle.offset({
            left: offset.left - $loupeCircle.outerWidth(true)
          })
            .css({
            display: 'block'
          });
        }
        if ($blognameArrow) {
          $blognameArrow.offset({
            left: offset.left + width
          })
            .css({
            display: 'block'
          });
        }
      }
{'fraction_non_alphanumeric': 0.1525124889803115, 'fraction_numerical': 0.0, 'mean_word_length': 2.5495307612095934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6329701', 'n_tokens_mistral': 996, 'n_tokens_neox': 998, 'n_words': 164}