window._config = {
  isDebug: ['localhost', 'dev.bootstrap-table.com'].indexOf(location.hostname) > -1
}

function loadUrl(url_) {
  var hash = ''
  if (location.search.slice(1) === 'is-debug') {
    hash = '#is-debug'
  }
  var url = 'template.html?v=VERSION&url=' + url_ + hash
  if (window._config.isDebug) {
    url = 'template.html?t=' + (+new Date()) + '&url=' + url_ + hash
  }
  if (url_.indexOf('view-source') > -1) {
    url = 'template.html?v=VERSION&view-source&url=' + url_ + hash
  }
  $('iframe').attr('src', url)
}

function initNavigation(href) {
  var $el = $('a[href="#' + href + '"]')

  if (!$el.length) {
    return
  }

  $('#bd-docs-nav .active').removeClass('active')
  $el.parent().addClass('active')
  $el.parents('.bd-toc-item').addClass('active')
}

function doSearch() {
  var searchClient = window.algoliasearch('FXDJ517Z8G', '9b89c4a7048370f4809b0bc77b2564ac')

  var search = window.instantsearch({
    indexName: 'bootstrap-table-example',
    searchClient: searchClient,
    searchFunction: function (helper) {
      if (helper.state.query) {
        helper.search()
        $('#hits').show()
      } else {
        $('#hits').hide()
      }
    }
  })

  search.addWidget(
    window.instantsearch.widgets.searchBox({
      container: '#searchbox'
    })
  )

  search.addWidget(
    window.instantsearch.widgets.hits({
      container: '.hits-body',
      templates: {
        item: function (hit) {
          return [
            '<div class="link" data-href="' + hit.url + hit.anchor + '">',
            '<div class="category">',
            hit.anchor.split('/')[0].slice(1),
            '</div>',
            '<div class="title">',
            hit.title,
            '</div>',
            '<div class="description">',
            hit.description,
            '</div>',
            '</div>'
          ].join('')
        }
      }
    })
  )

  $(document).on('click', '.ais-Hits-item .link', function (e) {
    var href = $(e.currentTarget).data('href')
    if ($(e.target).is('a')) {
      return
    }
    location.href = href
    $('.ais-SearchBox-reset').click()
    $('.ais-SearchBox-input').blur()
  })

  search.start()
}

$(function () {
  $('.toggle').click(function () {
    $('.nav-list').toggleClass('active')
  })

  $('.bd-sidenav li').each(function () {
    $(this).attr('title', $.trim($(this).text()))
  })

  $('[data-toggle="tooltip"]').tooltip()

  $(document).on('click', '#navbar li a, .nav-list li a, .navigation a', function (e) {
    var href = $(this).attr('href')
    if (href === '#' || /^http.*/.test(href)) {
      return
    }
    e.preventDefault()
    if (location.search.slice(1) === 'view-source') {
      location.href = 'index.html#' + href
      return
    }

    $(this).blur()
    $('.nav-list').removeClass('active')
    location.hash = href
    loadUrl(href)
    initNavigation(href)
  })

  $(window).hashchange(function () {
    var href = location.hash.substring(1)
    loadUrl(href)
    initNavigation(href)
  })

  $(window).on('blur',function() {
    $('.dropdown-toggle').parent().removeClass('open')
  })

  var href = location.hash.substring(1) || 'welcome.html'
  loadUrl(href)
  initNavigation(href)
  doSearch()
})

@@ -597,16 +597,45 @@
  + '%22%5D')
+%0A  var $parent = $el.parent()
 %0A%0A  if (
@@ -718,27 +718,22 @@
 ve')%0A  $
-el.
 parent
-()
 .addClas
@@ -792,24 +792,265 @@
 active')%0A%7D%0A%0A
+function autoScrollNavigation () %7B%0A  var $el = $('.bd-sidenav %3Eli.active')%0A  $('#bd-docs-nav').scrollTop(0)%0A  if ($el.offset().top %3E $(window).height() / 2) %7B%0A    $('#bd-docs-nav').scrollTop($el.offset().top - $(window).height() / 2)%0A  %7D%0A%7D%0A%0A
 function doS
@@ -2408,129 +2408,89 @@
 )%0A  
-%7D)%0A%0A  search.start()%0A%7D%0A%0A$(function () %7B%0A  $('.toggle').click(function () %7B%0A    $('.nav-list').toggleClass('active')%0A  %7D)%0A
+  setTimeout(autoScrollNavigation, 200)%0A  %7D)%0A%0A  search.start()%0A%7D%0A%0A$(function () %7B
 %0A  $
@@ -2629,473 +2629,8 @@
 ()%0A%0A
-  $(document).on('click', '#navbar li a, .nav-list li a, .navigation a', function (e) %7B%0A    var href = $(this).attr('href')%0A    if (href === '#' %7C%7C /%5Ehttp.*/.test(href)) %7B%0A      return%0A    %7D%0A    e.preventDefault()%0A    if (location.search.slice(1) === 'view-source') %7B%0A      location.href = 'index.html#' + href%0A      return%0A    %7D%0A%0A    $(this).blur()%0A    $('.nav-list').removeClass('active')%0A    location.hash = href%0A    loadUrl(href)%0A    initNavigation(href)%0A  %7D)%0A%0A
   $(
@@ -2757,104 +2757,8 @@
 %7D)%0A%0A
-  $(window).on('blur',function() %7B%0A    $('.dropdown-toggle').parent().removeClass('open')%0A  %7D)%0A%0A
   va
@@ -2850,16 +2850,41 @@
 n(href)%0A
+  autoScrollNavigation()%0A
   doSear

Add auto scroll nav