Commit e76ab3f5 by Bach Dániel

dashboard: fix TypeError in help.js

parent 11ddfd1e
$(function() { $(function() {
$('.crosslink').click(function(e) { $('.crosslink').click(function(e) {
e.preventDefault(); e.preventDefault();
...@@ -9,14 +8,15 @@ $(function() { ...@@ -9,14 +8,15 @@ $(function() {
var hash = window.location.hash; var hash = window.location.hash;
if(hash) { if(hash) {
var menu; var pane = $(hash).closest(".tab-pane").prop("class");
if($(hash).closest(".tab-pane").prop("class").indexOf("overview") != -1) { if (pane) {
menu = "#overview_menu"; if (pane.indexOf("overview") != -1) {
$("#overview_menu").click();
} else { } else {
menu = "#faq_menu"; $("#faq_menu").click();
} }
$(menu).click();
$("html, body").animate({scrollTop: $(hash).offset().top}, 500); $("html, body").animate({scrollTop: $(hash).offset().top}, 500);
window.location.hash = hash; window.location.hash = hash;
} }
}
}); });
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
<div class="content"> <div class="content">
<ul class="help-tabs nav nav-tabs"> <ul class="help-tabs nav nav-tabs">
<li class="active"> <li class="active">
<a id="faq_menu" href="#" data-toggle="pill" data-target="._faq" class="text-center" > <a id="faq_menu" href="#faq" data-toggle="pill" data-target="._faq" class="text-center" >
<i class="fa fa-comments-o fa-2x"></i> <i class="fa fa-comments-o fa-2x"></i>
<br> <br>
{% trans "FAQ" %} {% trans "FAQ" %}
</a> </a>
</li> </li>
<li> <li>
<a id="overview_menu" href="#" data-toggle="pill" data-target="._overview" class="text-center" > <a id="overview_menu" href="#overview" data-toggle="pill" data-target="._overview" class="text-center" >
<i class="fa fa-book fa-2x"></i><br> <i class="fa fa-book fa-2x"></i><br>
{% trans "Overview" %}</a> {% trans "Overview" %}</a>
</li> </li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment