<commit_before><template>
  <nav v-el:navbar :class="['navbar',{
    'navbar-inverse':(type == 'inverse'),
    'navbar-default':(type == 'default'),
    'navbar-fixed-top':(placement === 'top'),
    'navbar-fixed-bottom':(placement === 'bottom'),
    'navbar-static-top':(placement === 'static')
  }]">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#{{ id }}" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <slot name="brand"></slot>
      </div>
      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="{{ id }}">
        <ul class="nav navbar-nav">
          <slot></slot>
        </ul>
        <ul class="nav navbar-nav navbar-right">
          <slot name="right"></slot>
        </ul>
      </div>
    </div><!-- /.container-fluid -->
  </nav>
</template>

<script>
import $ from './utils/NodeList.js'

export default {
  props: {
    type: {
      type: String,
      default: 'default'
    },
    placement: {
      type: String,
      default: 'top'
    }
  },
  data () {
    return {
      id: 'bs-example-navbar-collapse-1',
      styles: {}
    }
  },
  computed: {
    navbar () {
      return true
    }
  },
  methods: {
    toggleCollapse (e) {
      e.preventDefault()
      // collapse data-target
      var tmp = this.$el.querySelector('[data-target]')
      var id = tmp.getAttribute('data-target')
      var o = document.getElementById(id.substring(1))
      o.classList.toggle('collapse')
    }
  },
  ready () {
    const $dropdowns = $('.dropdown > .dropdown-toggle',this.$el)
    if ($dropdowns.length) {
      $dropdowns.on('click', (e) => {
        e.preventDefault()
        let dropDown = e.target.offsetParent
        let dropDownItems = dropDown.nextElementSibling.children
        dropDown.classList.add('open')

        $(dropDownItems).on('click', () => {
          dropDown.offsetParent.classList.remove('open')
        })
      })
    }
    $('[data-toggle="collapse"]',this.$el).on('click', (e) => this.toggleCollapse(e)).each((el) => {
      el.style.borderRadius = '4px'
    })
    this._close = (e) => {
      if (!this.$el.contains(e.target)) {
        this.$el.classList.remove('open')
      }
    }
    $(window).on('click', this._close)
  },
  beforeDestroy () {
    $('[data-toggle="collapse"]',this.$el).off('click')
    $(window).off('click', this._close)
  }
}
</script><commit_msg>fixed navbar<commit_after><template>
  <nav v-el:navbar :class="['navbar',{
    'navbar-inverse':(type == 'inverse'),
    'navbar-default':(type == 'default'),
    'navbar-fixed-top':(placement === 'top'),
    'navbar-fixed-bottom':(placement === 'bottom'),
    'navbar-static-top':(placement === 'static')
  }]">
    <div class="container-fluid">
      <div class="navbar-header">
        <button v-if="!slots.collapse" type="button" class="navbar-toggle collapsed"  aria-expanded="false" @click="toggleCollapse">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <slot name="collapse"></slot>
        <slot name="brand"></slot>
      </div>
      <div :class="['navbar-collapse',{collapse:collapsed}]">
        <ul class="nav navbar-nav">
          <slot></slot>
        </ul>
        <ul v-if="slots.right" class="nav navbar-nav navbar-right">
          <slot name="right"></slot>
        </ul>
      </div>
    </div>
  </nav>
</template>

<script>
import $ from './utils/NodeList.js'

export default {
  props: {
    type: {
      type: String,
      default: 'default'
    },
    placement: {
      type: String,
      default: 'top'
    }
  },
  data () {
    return {
      id: 'bs-example-navbar-collapse-1',
      collapsed: true,
      styles: {}
    }
  },
  computed: {
    slots () {
      return this._slotContents
    }
  },
  methods: {
    toggleCollapse (e) {
      e && e.preventDefault()
      this.collapsed = !this.collapsed
    }
  },
  created () {
    this._navbar = true
  },
  ready () {
    let $dropdown = $('.dropdown>[data-toggle="dropdown"]',this.$el).parent()
    $dropdown.on('click', '.dropdown-toggle', (e) => {
      e.preventDefault()
      $dropdown.each((content) => {
        if (content.contains(e.target)) {
          content.classList.toggle('open')
        }
      })
    }).on('click', '.dropdown-menu>li>a', (e) => {
      $dropdown.each((content) => {
        if (content.contains(e.target)) {
          content.classList.remove('open')
        }
      })
    }).onBlur((e) => {
      $dropdown.each((content) => {
        if (!content.contains(e.target)) {
          content.classList.remove('open')
        }
      })
    })
    let height = this.$el.offsetHeight
    if (this.placement === 'top') {
      document.body.style.paddingTop = height + 'px'
    }
    if (this.placement === 'bottom') {
      document.body.style.paddingBottom = height + 'px'
    }
    if (this.slots.collapse) $('[data-toggle="collapse"]',this.$el).on('click', (e) => this.toggleCollapse(e))
  },
  beforeDestroy () {
    $('.dropdown',this.$el).off('click').offBlur()
    if (this.slots.collapse) $('[data-toggle="collapse"]',this.$el).off('click')
  }
}
</script>
{'fraction_non_alphanumeric': 0.20092543157145398, 'fraction_numerical': 0.0007118704395799964, 'mean_word_length': 2.424741011578306, 'pattern_counts': {'":': 0, '<': 72, '<?xml version=': 0, '>': 88, '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': '6561585', 'n_tokens_mistral': 1824, 'n_tokens_neox': 1803, 'n_words': 305}