3dAController.js 3.26 KB
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) {
        $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 },

        //});
    }

   
   
}]



);