Commit 365dba0b191bb4af3515820bccdae9b20d7d3e90

Authored by Amrita Vishnoi
2 parents 5a0caa54 7923eb03

Merge Request #602 request

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -33,7 +33,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
33 33 selectedorientation: '',
34 34 selectedimagetype: '',
35 35 };
36   -
  36 + $scope.activePinArray = [];
37 37 $scope.showTabButton = true;
38 38 $scope.isListViewDataLoaded = true;
39 39  
... ... @@ -362,6 +362,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
362 362 console.log(' error in showAllPins: ' + error.statusText);
363 363 }
364 364 )
  365 + if ($scope.isSliderChange == true) {
  366 + $timeout(function () {
  367 + $scope.activePinOnLayerChange();
  368 + }, 1000);
  369 +
  370 + }
  371 +
365 372 }
366 373  
367 374  
... ... @@ -1049,16 +1056,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1049 1056 radius: 5 * $scope.sliderPercentValue,
1050 1057  
1051 1058 click: function (clickedPin) {
1052   - // alert('pin clciked = ' + clickedPin.name)
1053   -
1054 1059 if (clickedPin.event.ctrlKey == false) {
1055 1060 $scope.clickedPins = [];
1056 1061 }
1057   -
1058 1062 var pinID = (clickedPin.name).substring(7, (clickedPin.name).length);
1059   - // alert('pinId: ' + pinID);
1060   - //showAnnotation();
1061   -
1062 1063 var pinData = new jinqJs()
1063 1064 .from($scope.aaPinData)
1064 1065 .where("_PinId == " + pinID)
... ... @@ -1088,7 +1089,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1088 1089 .where("_PinId == " + pinID)
1089 1090 .select();
1090 1091 if (clickedPin.event.ctrlKey == true) {
1091   -
  1092 +
  1093 + $scope.activePinArray.push(clickedPin.name);
1092 1094 var radialAfterClick = $('#aaDetailViewCanvas').createGradient({
1093 1095 x1: 50, y1: 50,
1094 1096 x2: 50, y2: 50,
... ... @@ -1096,12 +1098,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1096 1098 c1: 'rgba(100, 50, 0,0)',
1097 1099 c2: 'rgb(126, 187, 83)'
1098 1100 });
1099   -
1100 1101 clickedPin.fillStyle = radialAfterClick;
1101 1102 $scope.showAnnotation(selectedPinData, true, true, false);
1102   -
1103 1103 }
1104 1104 else {
  1105 + $scope.activePinArray = [];
  1106 + $scope.activePinArray.push(clickedPin.name);
1105 1107 var radial = $('#aaDetailViewCanvas').createGradient({
1106 1108 x1: 50, y1: 50,
1107 1109 x2: 50, y2: 50,
... ... @@ -1190,12 +1192,22 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1190 1192 .from($scope.AAPinTermData)
1191 1193 .where('_LanguageId == ' + primaryLexicon)
1192 1194 .select();
1193   - var sortedTermTextArray = [];
  1195 + var sortedTermTextArray = [];
1194 1196 for (var i = 0; i < $scope.matchedLanguageTermData.length; i++) {
1195 1197 sortedTermTextArray.push($scope.matchedLanguageTermData[i]._TermText);
1196 1198 sortedTermTextArray.sort();
1197 1199 }
1198   -
  1200 +
  1201 + for (var i = 0; i <= sortedTermTextArray.length - 1; i++) {
  1202 + for(var j = 0;j<= $scope.matchedLanguageTermData.length-1;j++){
  1203 + if ($scope.matchedLanguageTermData[j]._TermText == sortedTermTextArray[i])
  1204 + {
  1205 + $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[j]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[j]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[j]._TermText });
  1206 + break;
  1207 + }
  1208 + }
  1209 + }
  1210 +
1199 1211 for (var i = 0; i <= sortedTermTextArray.length - 1; i++) {
1200 1212 for (var j = 0; j <= $scope.matchedLanguageTermData.length - 1; j++) {
1201 1213 if ($scope.matchedLanguageTermData[j]._TermText == sortedTermTextArray[i]) {
... ... @@ -1269,13 +1281,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1269 1281  
1270 1282  
1271 1283 $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) {
1272   -
  1284 + $('#termList').empty();
1273 1285 $rootScope.bodySystemSeletedId = bodySystemId;
1274 1286 $('#termList').empty();
1275 1287 var bodySystemName = $("#AABodySystems #" + bodySystemId).val();
1276 1288 if (bodySystemName == "All") {
1277 1289 for (var j = 0; j <= $scope.pinTermData.length - 1; j++) {
1278   - var $selectedOptions = $('<option title= "' + $scope.pinTermData[j].TermTxt + '" id= "' + $scope.pinTermData[j].TermNumber + '" onclick="onSearchItemSelection(event)">' + $scope.pinTermData[j].TermTxt + '</option>').appendTo("#termList")
  1290 +
1279 1291 $compile($selectedOptions)($scope);
1280 1292 }
1281 1293 $("#totalTerms").empty();
... ... @@ -1285,7 +1297,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1285 1297 var imageId = $rootScope.imageId;
1286 1298 $scope.pinDataUrl = "aa_dat_pinterm_" + imageId;
1287 1299 $rootScope.bodySystemTermArray = [];
1288   -
  1300 +
1289 1301 $.ajax({
1290 1302 url: '~/../content/data/json/aa/aa_pinterm/' + $scope.pinDataUrl + '.json',
1291 1303 type: 'GET',
... ... @@ -1589,12 +1601,26 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1589 1601 }
1590 1602 }
1591 1603 }
1592   -
  1604 + $scope.activePinOnLayerChange = function () {
  1605 + for (var i = 0; i <= $scope.activePinArray.length - 1; i++) {
  1606 + var radialAfterClick = $('#aaDetailViewCanvas').createGradient({
  1607 + x1: 50, y1: 50,
  1608 + x2: 50, y2: 50,
  1609 + r1: 10, r2: 30,
  1610 + c1: 'rgba(100, 50, 0,0)',
  1611 + c2: 'rgb(126, 187, 83)'
  1612 + });
  1613 + var clickedPin = $scope.activePinArray[i];
  1614 + $('#aaDetailViewCanvas').setLayer(clickedPin, {
  1615 + fillStyle: radialAfterClick
  1616 + }).drawLayers();
  1617 +
  1618 + }
  1619 + }
1593 1620 }]);
1594 1621  
1595 1622  
1596 1623 function refreshTermListOnSystemSel(bodySystemId) {
1597   -
1598 1624 var rootScope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
1599 1625 rootScope.$apply(function () {
1600 1626 rootScope.refreshTermListOnAASystemSelection(bodySystemId);
... ... @@ -1729,6 +1755,7 @@ function onZoom(scope) {
1729 1755  
1730 1756  
1731 1757 $(document).ready(function () {
  1758 +
1732 1759 $(".slider").slider({
1733 1760 min: 25,
1734 1761 max: 100,
... ... @@ -1736,9 +1763,6 @@ $(document).ready(function () {
1736 1763 range: "min",
1737 1764 orientation: "vertical",
1738 1765 slide: function (event, ui) {
1739   -
1740   -
1741   -
1742 1766 var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
1743 1767 scope.$apply(function () {
1744 1768 scope.sliderVal = ui.value;
... ... @@ -1805,12 +1829,11 @@ $(document).ready(function () {
1805 1829 scope.context = canvas.getContext("2d")
1806 1830 $("#modItemImage").attr('src', scope.OpenItemImagePath);
1807 1831 scope.isSliderChange = true;
  1832 +
1808 1833 scope.showAllPins();
  1834 +
1809 1835 }
1810   -
1811   -
1812 1836  
1813   -
1814 1837 });
1815 1838 }
1816 1839 })
... ...