unserver-unify
Version:
47 lines (42 loc) • 1.31 kB
JavaScript
'use strict';
angular.module('bamboo.help').controller('ScrollCtrl', function($scope,$rootScope, $location, AppConfig, $anchorScroll, loginService) {
$scope.oneAtATime = true;
//console.log(loginService.school);
$scope.toogleOpen = function() {
$scope.isopen = !$scope.isopen;
for (var i = 0; i < $scope.groups.length; i++) {
$scope.groups[i].isopen = $scope.isopen;
}
for (var i = 0; i < $scope.group2.length; i++) {
$scope.group2[i].isopen = $scope.isopen;
}
}
if(loginService.school.marketPlaceFlag){
if ($rootScope.currentLanguage == "Chinese") {
$scope.groups = AppConfig.Market_CN;
$scope.group2 = AppConfig.STEP_CN;
} else {
$scope.groups = AppConfig.Market_EN;
$scope.group2 = AppConfig.STEP_EN;
}
}
else{
if ($rootScope.currentLanguage == "Chinese") {
$scope.groups = AppConfig.FAQ_CN;
} else {
$scope.groups = AppConfig.FAQ_EN;
}
}
if(loginService.subDomain == 'stec'){
if ($rootScope.currentLanguage == "Chinese") {
$scope.groups = AppConfig.Stec_CN;
} else {
$scope.groups = AppConfig.Stec_EN;
}
}
//$scope.toogleOpen();
$scope.scrollTo = function(id) {
$location.hash(id);
$anchorScroll();
};
});