3dAController.js
3.67 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
AIA.controller("3dAController", ["$scope", "$rootScope", "pages", "$log", '$http', 'DataService', '$filter', '$location', '$document', '$sce', "$compile",
function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location, $document, $sce, $compile) {
// $rootScope.currentActiveModuleTitle = pages[5].name;
$scope.showme = false;
$scope.threedanatomyData;
$scope.Id;
$scope.$on('$viewContentLoaded', function (event) {
//get current path
var currentURL = $location.path();
var selectedModuleName = '';
//set module title
angular.forEach($rootScope.userModules, function (value, key) {
if (value.slug === currentURL.replace('/', '')) {
selectedModuleName = value.name;
}
$rootScope.currentActiveModuleTitle = selectedModuleName;
})
$scope.GetBodySystemNames();
//$scope.scroll();
});
$scope.scroll = function () {
// $window.scrollTo(0, 0);
$("html,body").scrollTop(0);
//alert("scroll");
}
$scope.IsVisible = function () {
//$scope.scroll();
$location.url("/3dAnatomy");
}
$scope.scroll = function () {
// $window.scrollTo(0, 0);
$("html,body").scrollTop(0);
//alert("scroll");
}
// getting list of body system modules
$scope.GetBodySystemNames = function () {
var ThreeDAModulePath = '~/../content/data/json/3da/3da_dat_contentlist.json';
DataService.getAnotherJson(ThreeDAModulePath).then(
function (result) {
//debugger;
$scope.threedanatomyData = result;
$scope.selectedthreeDAdata = $scope.threedanatomyData.root.ThreeDAData;
},
function (error) {
console.log(error.statusText)
}
)
}
$scope.showDetails = function (id) {
//$scope.open3dImageView(id);
localStorage.setItem("currentBodyViewId", id);
$location.url("/3d-anatomy-details");
}
$scope.open3dImageView = function ()
{
$scope.Id = localStorage.getItem("currentBodyViewId");
var ThreeDAModulePath = '~/../content/data/json/3da/3da_dat_contentlist.json';
DataService.getAnotherJson(ThreeDAModulePath).then(
function (result) {
$scope.threedanatomyData = result;
$scope.selectedthreeDAdata = $scope.threedanatomyData.root.ThreeDAData;
//alert(JSON.stringify($scope.selectedthreeDAdata))
var clicked3dAview = [];
clicked3dAview = new jinqJs().from($scope.selectedthreeDAdata)
.where('_id == ' + $scope.Id)
.select('_Title', '_3dimagepath');
$scope.SelectedCAthumbImage = clicked3dAview[0]._3dimagepath;
$scope.bodySystemTitle = clicked3dAview[0]._Title;
},
function (error) {
console.log(error.statusText)
}
)
localStorage.setItem("currentViewTitle", "3DAnatomy");
//$.jsPanel({
// id: 'daImagePanel',
// selector: '.daBodyView',
// theme: 'success',
// currentController: '3dAController',
// parentSlug: '3d-anatomy-details',
// ajax: {
// url: 'app/views/3dA/3d-anatomy-details.html'
// },
// title: localStorage.getItem("currentViewTitle"),
// position: {
// top: 70,
// left: 1,
// },
// size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 },
//});
}
}]
);