fix(accordion): Move jQuery to static.js

This commit is contained in:
Sabe Jones
2015-09-04 17:19:23 -04:00
parent 8213643485
commit 0a71037095
2 changed files with 19 additions and 18 deletions
+17
View File
@@ -40,3 +40,20 @@ window.habitrpg = angular.module('habitrpg', ['chieffancypants.loadingBar', 'ui.
});
});
}])
.controller('AccordionCtrl', function() {
function openHashAccordion() {
if (window.location.hash) {
var $target = $(window.location.hash.replace('/',''));
if ($target.hasClass('collapse')) {
$target.collapse('show');
$('html, body').animate({
scrollTop: $($target).offset().top - 100
});
}
}
}
$(document).ready(function(){
openHashAccordion();
});
})
+2 -18
View File
@@ -8,23 +8,7 @@ block title
=env.t('FAQ')
block content
script(type='text/javascript').
function openHashAccordion() {
if (window.location.hash) {
var $target = $(window.location.hash.replace('/',''));
if ($target.hasClass('collapse')) {
$target.collapse('show');
$('html, body').animate({
scrollTop: $($target).offset().top - 100
});
}
}
}
$(document).ready(function(){
openHashAccordion();
});
.row
.row(ng-controller='AccordionCtrl')
.col-md-12
.page-header
h1=env.t('frequentlyAskedQuestions')
@@ -34,7 +18,7 @@ block content
=env.t('September')
| 4, 2015
a.h2.accordion.collapsed(href='#overview' data-toggle='collapse')=env.t('FAQheaderOverview')
.clearfix.collapse#overview
.clearfix.collapse#overview
p!=env.t('FAQbodyOverview-1')
a.h2.accordion.collapsed(href='#set-up-tasks' data-toggle='collapse')=env.t('FAQheaderSetUpTasks')
.clearfix.collapse#set-up-tasks