'use strict'; AIA.controller("TinyViewListController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "Modules", "$routeParams", "DataService", function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, Modules, $routeParam, DataService) { var ATLAS_ANATOMY = 'Atlas Anatomy'; var CLINICAL_ILLUSTRATION ='Clinical Illustrations'; var CLINICAL_ANIMATION='Clinical Animations'; $scope.loadForModuleById = function (moduleId) { console.log('loadForModuleById is called') var moduleName = Modules[moduleId].Name; $scope.loadDataForModule(moduleName); } $scope.loadDataForModule = function (moduleName) { console.log('loadDataForModule is called') 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) { $scope.imagePath = "~/../content/images/aa/thumbnails/" + value._TinyImageName; var $el = $('
' + '
' + '' + '

' + value._Title + '

').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); } }]);