Commit d58e51ae2aafbf48ae84d462d69a9f709bcaaf76

Authored by Nikita Kulshreshtha
1 parent b58bbfbf

using ng-repeat to bind CI images.

400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... ... @@ -158,7 +158,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
158 158 };
159 159  
160 160 $scope.loadAllCI = function () {
161   -
  161 + $('#ciSpinner').css('visibility', 'visible');
  162 + $('#ciSpinner').css('zIndex', '20000');
162 163 var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json')
163 164 promise.then(
164 165 function (result) {
... ... @@ -170,32 +171,41 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
170 171 .select();
171 172  
172 173 // console.log($scope.selectedCIListViewData);
173   - $('#grid-view').empty();
174   - angular.forEach($scope.selectedCIListViewData, function (value, key) {
175   - $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage;
  174 +
176 175  
177   - var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">'
  176 +
  177 + $('#grid-view').empty();
  178 + var $e1 = $('<ul><li ng-repeat="value in selectedCIListViewData" ><div id="{{value._id}}" class="col-sm-3 col-md-2" title = "{{value._Title}}" data-ng-click="openView($event)">'
178 179 + '<div class="thumbnail" >'
179   - + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'
180   - + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
  180 + + '<img id="{{value._Title}}" ng-src="~/../content/images/ci/thumbnails/{{value._ThumbnailImage}}" >'//alt="{{value._Title}}" >'
  181 + + '<div class="caption"><p> {{value._Title}}</p></div></a></div></div></li></ul>').appendTo('#grid-view');
  182 + $compile($e1)($scope);
  183 + //angular.forEach($scope.selectedCIListViewData, function (value, key) {
  184 + // $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage;
181 185  
  186 + // var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-2" title = "' + value._Title + '" data-ng-click="openView($event)">'
  187 + // + '<div class="thumbnail" >'
  188 + // + '<img id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'
  189 + // + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
182 190  
183   - $compile($el)($scope);
184 191  
185   - $(".sidebar").mCustomScrollbar({
186   - autoHideScrollbar: true,
187   - //theme:"rounded"
188   - });
  192 + // $compile($el)($scope);
189 193  
190   - });
  194 + // $(".sidebar").mCustomScrollbar({
  195 + // autoHideScrollbar: true,
  196 + // //theme:"rounded"
  197 + // });
191 198  
  199 + //});
  200 +
  201 + $timeout(function () { $('#ciSpinner').css('visibility', 'hidden'); }, 200);
192 202 },
193 203 function (error) {
194 204 // handle errors here
195 205 console.log(' $scope.IllustrationData = ' + error.statusText);
196 206 }
197 207 );
198   -
  208 +
199 209 }
200 210  
201 211 $scope.IsVisible = function () {
... ...