CIController.js
2.85 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
AIA.controller("CIController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "pages",
function ($scope, $window, $rootScope, $compile,$http,log,pages) {
$rootScope.currentActiveModuleTitle = pages[3].name;
$scope.showme = true;
$scope.IllustrationData;
$scope.selectedCIlistViewData;
$scope.IsVisible = function () {
$scope.scroll();
}
$scope.scroll = function () {
// $window.scrollTo(0, 0);
$("html,body").scrollTop(0);
//alert("scroll");
}
$scope.getDAViewList = function ($event) {
//debugger;
$scope.selectedCIlistViewData = new jinqJs()
.from($scope.IllustrationData.root.CIData)
.select();
angular.forEach($scope.selectedCIlistViewData, function (value, key) {
$('#grid-view').empty();
$scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage;
// alert("ImagePath");
// debugger;
var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2"><div class="thumbnail" ><a href="clinical-illustrations-detail.html">'
+ '<img src="' + $scope.imagePath + '" alt="" title="" >'
+ '<div class="caption"><p>' + value._title + '</p></div></a></div></div>').appendTo('#grid-view');
//<div class="col-sm-3 col-lg-2">
// <div class="thumbnail">
// <a href="clinical-illustrations-detail.html">
// <img src="~/../content/images/clinical-illustrations-2.jpg" alt="" title="">
// <div class="caption">
// <p>16-week fetus</p>
// </div>
// </a>
// </div>
// </div>
$compile($el)($scope);
//$(".sidebar").mCustomScrollbar({
// autoHideScrollbar: true,
// //theme:"rounded"
//});
});
};
//
$scope.loadClinicalIllustrationData = function () {
$rootScope.ClearIframe();
//load bodyView data
alert("getting data");
$http({ method: 'GET', url: '~/../content/data/json/ci/ci_dat_content_without_summary.json' })
.success(function (data) {
// debugger;
$scope.IllustrationData = data;
//load default body view list for male
$scope.getDAViewList();
// var value = $scope.IllustrationData[4]._Title;
//load default body view list for male
// $scope.getDAViewList();
// alert("Done");
})
.error(function (data, status, headers, config) {
console.log(data);
}
);
}
}]
);