TileViewListController.js
6.05 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/// <reference path="../views/atlas-anatomy-detail.html" />
/// <reference path="../views/atlas-anatomy-detail.html" />
'use strict';
AIA.controller("TileViewListController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "$timeout", "Modules", "$routeParams", "DataService","ModuleService" ,
function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, BodySystems, ViewOrientations, ImageTypes, $timeout, Modules, $routeParam, DataService,ModuleService)
{
var ATLAS_ANATOMY = 'Atlas Anatomy';
var CLINICAL_ILLUSTRATION ='Clinical Illustrations';
var CLINICAL_ANIMATION='Clinical Animations';
var moduleData = [];
$scope.AllBodyRegion = [];
$scope.AllBodySystem = [];
$scope.AllOrientation = [];
$scope.AllImageType = [];
$scope.moduleData = [];
$scope.loadForModuleById = function (moduleId) {
$scope.moduleId = moduleId;
console.log('loadForModuleById is called')
var moduleName = Modules[moduleId].Name;
var promise = ModuleService.loadModuleDataBasedOnModuleName(moduleName)
.then(
function (result) {
$scope.moduleLandingData = result;
console.log(JSON.stringify(result, null, 4));
},
function (error) {
// handle errors here
console.log(' error: ' + error.statusText);
}
)
},
// var abc= ModuleService.loadModuleDataBasedOnModuleName($scope.moduleName)
// abc.then(
// function (result) {
// var data = result;
// alert('returned data: ' + data);
// },
// function (error) {
// alert('returned error: ' + abc);
// console.log(' $rootScope.TermNumberData= ' + error.statusText);
// }
// )
//};
//$scope.loadDataForModule = function (moduleName)
//{
// //0. load filter static data
// $scope.AllBodyRegion = BodyRegions;
// $scope.AllBodySystem = BodySystems;
// $scope.AllOrientation = ViewOrientations;
// $scope.AllImageType = ImageTypes;
// //1. load dynamic data for module specific images
// var jsonPath;
// if(moduleName==ATLAS_ANATOMY)
// {
// jsonPath ='~/../content/data/json/aa/aa_dat_contentlist.json';
// }
// else if(moduleName == CLINICAL_ANIMATION)
// {
// //to do, in next phase of project
// jsonPath ='~/../content/data/json/ca/ca_dat_contentlist.json';
// }
// else if(moduleName == CLINICAL_ILLUSTRATION)
// {
// //to do, in next phase of project
// jsonPath ='~/../content/data/json/ci/ci_dat_contentlist.json';
// }
// var promise = DataService.getJson(jsonPath)
// promise.then(
// function (result) {
// $scope.AtlasAnatomyData = result;
// $scope.data = new jinqJs()
// .from($scope.AtlasAnatomyData.root.Item)
// .orderBy([{ field: '_Title', sort: 'asc' }])
// .select();
// //console.log($scope.selectedCIListViewData);
// //$('#grid-view').empty();
// angular.forEach($scope.data, function (value, key)
// {
// // $rootScope.moduleData = [];
// $scope.moduleData.push({ "id": value._Id, "imageID": value._ImageId, "TileName": value._TileImageName, "DivImageTitle": value._Title });
// // $scope.moduleData.push(value._ImageId);
// // $scope.moduleData.push(value._TileImageName);
// $scope.ImageName = value._TileImageName;
// $scope.imagePath = "~/../content/images/aa/thumbnails/" + value._TileImageName;
// $scope.TileViewId = value._Id;
// var $el = $('<div id="' + value._Id + '" class="col-sm-3 col-md-3" title = "' + value._Title + '" data-ng-click="openModuleItem()">'
// + '<div class="thumbnail" >'
// + '<img class="tinyImg" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'
// + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
// $compile($el)($scope);
// //$(".sidebar").mCustomScrollbar({
// // autoHideScrollbar: true,
// // //theme:"rounded"
// //});
// });
// $scope.scroll();
// },
// function (error) {
// // handle errors here
// console.log(' $scope.IllustrationData = ' + error.statusText);
// }
// );
//}
$scope.scroll = function () {
$("html,body").scrollTop(0);
}
$scope.openModuleItem = function (event) {
alert('hi');
//// debugger;
var moduleItemDataToBeSaved = event.target.id;
var OpendTileData = [];
OpendTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData);
$location.url('/atlas-anatomy-detail');
}
}]);