CurrBuildController.js
2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
AIA.controller("CurrBuildController", ["$scope", "$rootScope", "pages", "$log","Modules","$http","$compile",
function ($scope, $rootScope, pages, log,Modules,$http,$compile) {
$rootScope.currentActiveModuleTitle = pages[6].name;
$scope.showme = false;
$scope.listCurriculumBuilder = null;
$scope.countLeftlist;
$scope.countRightlist;
$scope.IsVisible = function () {
$scope.scroll();
}
$scope.scroll = function () {
// $window.scrollTo(0, 0);
$("html,body").scrollTop(0);
//alert("scroll");
}
//load json data
$scope.loadCurriculumBuiderData = function () {
$http({ method: 'GET', url: 'content/data/json/cb/cb_list_content.json' }).success(function (data) {
$scope.listCurriculumBuilder = data;
//load default body view list
$scope.getCBViewList();
})
.error(function (data, status, headers, config) {
console.log(data);
});
}
//get CB body view list
$scope.getCBViewList = function ($event) {
$('#leftBodyViewList').empty();
$scope.countLeftlist = Object.keys($scope.listCurriculumBuilder.slideshows.slideshow).length / 2;
$scope.loadleftBodyViewList = new jinqJs()
.from($scope.listCurriculumBuilder.slideshows.slideshow)
.select();
for (var i = 0; i < $scope.countLeftlist; i++) {
console.log($scope.listCurriculumBuilder.slideshows.slideshow[i]._label);
var $el = $('<li class="list-group-item" data-toggle="modal" data-target="#myModal-1" ng-click="loadSlideShowXmldata()"><a href="#"><i class="fa fa-check"></i>' + $scope.listCurriculumBuilder.slideshows.slideshow[i]._label + '</a></li>').appendTo('#leftBodyViewList');
$compile($el)($scope);
}
$scope.countRightlist = Object.keys($scope.listCurriculumBuilder.slideshows.slideshow).length;
for (var i = $scope.countLeftlist; i < $scope.countRightlist; i++) {
console.log($scope.listCurriculumBuilder.slideshows.slideshow[i]._label);
var $el1 = $('<li class="list-group-item" data-toggle="modal" ng-click="loadSlideShowXmldata()" data-target="#myModal-1"><a href="#"><i class="fa fa-check"></i>' + $scope.listCurriculumBuilder.slideshows.slideshow[i]._label + '</a></li>').appendTo('#rightBodyViewList');
$compile($el)($scope);
}
}
$scope.loadSlideShowXmldata = function ($event) {
alert("asd");
}
}]
);