<commit_before>CATARSE.LayoutsApplicationView = Backbone.View.extend({

  initialize: function() {
    this.dropDownOpened = false;
    _.bindAll(this, "render", "flash", "currentUserDropDown")
    this.render();
  },

  events: {
    "submit .search": "search",
    "click a.my_profile_link":"currentUserDropDown",
    "click a.submit_project":"submitDropDown",
    "click a.explore":"exploreDropDown",
    "focus .form_login.bootstrap-form input":"markLoginForm",
    "focus .form_register.bootstrap-form input":"markRegisterForm",
  },

  markRegisterForm: function(e){
    rootElement = $(e.currentTarget).closest('.bootstrap-form')
    if(!rootElement.hasClass('actived')) {
      $('.bootstrap-form').removeClass('actived');
      rootElement.addClass('actived');
    }
  },

  markLoginForm: function(e){
    rootElement = $(e.currentTarget).closest('.bootstrap-form')
    if(!rootElement.hasClass('actived')) {
      $('.bootstrap-form').removeClass('actived');
      rootElement.addClass('actived');
    }
  },

  search: function(event) {
    var query = this.$(event.target).find("#search").val()
    if(!($('#main_content').data("controller-name") == "explore" && $('#main_content').data("action") == "index") && query.length > 0)
      location.href = "/explore#search/" + query
    return false
  },

  flash: function() {
    setTimeout( function(){ this.$('.flash').slideDown('slow') }, 100)
    if( ! this.$('.flash a').length) setTimeout( function(){ this.$('.flash').slideUp('slow') }, 16000)
    $(window).click(function(){ this.$('.flash').slideUp() })
  },

  currentUserDropDown: function(e) {
    e.preventDefault();
    $dropdown = this.$('.dropdown.user');
    if(!this.dropDownOpened) {
      $dropdown.show();
      this.dropDownOpened = true;
    } else {
      this.dropDownOpened = false;
      $dropdown.hide();
    }

  },
  
  submitDropDown: function(e) {
    e.preventDefault();
    $dropdown = this.$('.dropdown.submit-project');
    if(!this.dropDownOpened) {
      $dropdown.show();
      this.dropDownOpened = true;
    } else {
      this.dropDownOpened = false;
      $dropdown.hide();
    }

  },

  exploreDropDown: function(e) {
    e.preventDefault();
    $dropdown = this.$('.dropdown.explore-projects');
    if(!this.dropDownOpened) {
      $dropdown.show();
      this.dropDownOpened = true;
    } else {
      this.dropDownOpened = false;
      $dropdown.hide();
    }

  },
  
  render: function(){
    this.flash()
  }

})<commit_msg>Fixed overlapping explore and submit dropdowns<commit_after>CATARSE.LayoutsApplicationView = Backbone.View.extend({

  initialize: function() {
    this.dropDownOpened = false;
    _.bindAll(this, "render", "flash", "currentUserDropDown")
    this.render();
  },

  events: {
    "submit .search": "search",
    "click a.my_profile_link":"currentUserDropDown",
    "click a.submit_project":"submitDropDown",
    "click a.explore":"exploreDropDown",
    "focus .form_login.bootstrap-form input":"markLoginForm",
    "focus .form_register.bootstrap-form input":"markRegisterForm",
  },

  markRegisterForm: function(e){
    rootElement = $(e.currentTarget).closest('.bootstrap-form')
    if(!rootElement.hasClass('actived')) {
      $('.bootstrap-form').removeClass('actived');
      rootElement.addClass('actived');
    }
  },

  markLoginForm: function(e){
    rootElement = $(e.currentTarget).closest('.bootstrap-form')
    if(!rootElement.hasClass('actived')) {
      $('.bootstrap-form').removeClass('actived');
      rootElement.addClass('actived');
    }
  },

  search: function(event) {
    var query = this.$(event.target).find("#search").val()
    if(!($('#main_content').data("controller-name") == "explore" && $('#main_content').data("action") == "index") && query.length > 0)
      location.href = "/explore#search/" + query
    return false
  },

  flash: function() {
    setTimeout( function(){ this.$('.flash').slideDown('slow') }, 100)
    if( ! this.$('.flash a').length) setTimeout( function(){ this.$('.flash').slideUp('slow') }, 16000)
    $(window).click(function(){ this.$('.flash').slideUp() })
  },

  currentUserDropDown: function(e) {
    e.preventDefault();
    $dropdown = this.$('.dropdown.user');
    if(!this.dropDownOpened) {
      $dropdown.show();
      this.dropDownOpened = true;
    } else {
      this.dropDownOpened = false;
      $dropdown.hide();
    }

  },
  
  submitDropDown: function(e) {
    e.preventDefault();
    $dropdown = this.$('.dropdown.submit-project');
    if(!this.dropDownOpened) {
      $dropdown.show();
      this.$('.dropdown.explore-projects').hide();
      this.dropDownOpened = true;
      this.exploreDropDownOpened = false;
    } else {
      this.dropDownOpened = false;
      $dropdown.hide();
    }

  },

  exploreDropDown: function(e) {
    e.preventDefault();
    $dropdown = this.$('.dropdown.explore-projects');
    if(!this.exploreDropDownOpened) {
      $dropdown.show();
      this.$('.dropdown.submit-project').hide();
      this.exploreDropDownOpened = true;
      this.dropDownOpened = false;
    } else {
      this.exploreDropDownOpened = false;
      $dropdown.hide();
    }

  },
  
  render: function(){
    this.flash()
  }

})
{'fraction_non_alphanumeric': 0.18719969248510474, 'fraction_numerical': 0.0034595425715933117, 'mean_word_length': 3.387858347386172, 'pattern_counts': {'":': 12, '<': 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': '2491971', 'n_tokens_mistral': 1654, 'n_tokens_neox': 1623, 'n_words': 239}