Sha256: 08346382cfd81e9757e4c3828e0fe8e31322d7846ab09cfa1b067ff08981bbee

Contents?: true

Size: 564 Bytes

Versions: 42

Compression:

Stored size: 564 Bytes

Contents

$(document).ready(function() {
  var $tab_with_error = $(".form-control.is-invalid").first().closest('.tab-pane');

  if ($tab_with_error.length > 0) {
    $(".nav.nav-tabs").find("a[href^='#" + $tab_with_error.attr('id') + "']").tab('show');
  } else if (document.location.hash.length > 0) {
    var $tab_from_url = $(".nav.nav-tabs").find("a[href^='" + document.location.hash + "']");

    if ($tab_from_url.length > 0) {
      document.location.hash = ""; // This prevents scrolling to the wrong place in the page
      $tab_from_url.tab("show");
    }
  }
});

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
effective_bootstrap-0.9.25 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.24 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.23 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.22 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.21 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.20 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.19 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.18 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.17 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.16 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.15 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.14 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.13 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.12 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.11 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.10 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.9 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.8 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.7 app/assets/javascripts/effective_bootstrap/tabs.js
effective_bootstrap-0.9.6 app/assets/javascripts/effective_bootstrap/tabs.js