Commit 2f03f48c9bf020ff951aa5fd48c0278952f89336

Authored by Nikita Kulshreshtha
1 parent 832feceb

there was issue in show slecetd pins, sometimes previouslyslecetd pins was also visible- fixed now

removed commneted code.
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -916,9 +916,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
916 916  
917 917  
918 918 $scope.drawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) {
  919 +
919 920 $scope.clickedPins = [];
920   - // if ($scope.isSliderChange == true) {
921   - console.log('isSliderrChange')
  921 +
922 922 var radial = $('#' + canvasId).createGradient({
923 923 x1: 50, y1: 50,
924 924 x2: 50, y2: 50,
... ... @@ -950,7 +950,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
950 950 radius: 5 * $scope.sliderPercentValue,
951 951  
952 952 click: function (clickedPin) {
953   - // alert('pin clciked = ' + clickedPin.name)
954 953 //change the head color to green
955 954 var radialAfterClick = $('#aaDetailViewCanvas').createGradient({
956 955 x1: 50, y1: 50,
... ... @@ -962,9 +961,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
962 961  
963 962 clickedPin.fillStyle = radialAfterClick;
964 963  
  964 + if (clickedPin.event.ctrlKey == false) {
  965 + $scope.clickedPins = [];
  966 + }
  967 +
965 968 var pinID = (clickedPin.name).substring(7, (clickedPin.name).length);
966   - // alert('pinId: ' + pinID);
967   - //showAnnotation();
  969 +
968 970  
969 971 var pinData = new jinqJs()
970 972 .from($scope.aaPinData)
... ... @@ -1007,97 +1009,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1007 1009 }
1008 1010  
1009 1011 }).drawLayers();
1010   - //}
1011   - // else
1012   - // {
1013   - // var radial = $('#' + canvasId).createGradient({
1014   - // x1: 50, y1: 50,
1015   - // x2: 50, y2: 50,
1016   - // r1: 10, r2: 30,
1017   - // c1: 'rgba(100, 50, 0,0)',
1018   - // c2: 'rgb(216, 216, 216)'
1019   - // });
1020   - // $('#' + canvasId).drawLine({
1021   -
1022   - // layer: true,
1023   - // name: "Pin_" + PinId,
1024   - // groups: ["Pin_" + PinId],
1025   - // strokeStyle: 'black',
1026   - // strokeWidth: 2,
1027   - // visible: true,
1028   - // x1: offsetX1, y1: offsetY1,
1029   - // x2: x, y2: y,
1030   -
1031   - // }).drawArc({
1032   - // name: "PinArc_" + PinId,
1033   - // layer: true,
1034   - // groups: ["Pin_" + PinId],
1035   - // strokeStyle: 'grey',
1036   - // strokeWidth: 2,
1037   - // visible: true,
1038   - // fillStyle: radial,
1039   - // x: x, y: y,
1040   - // radius: 5,
1041   -
1042   - // click: function (clickedPin) {
1043   - // alert('pin clciked = ' + clickedPin.name) //change the head color to green
1044   - // var radialAfterClick = $('#aaDetailViewCanvas').createGradient({
1045   - // x1: 50, y1: 50,
1046   - // x2: 50, y2: 50,
1047   - // r1: 10, r2: 30,
1048   - // c1: 'rgba(100, 50, 0,0)',
1049   - // c2: 'rgb(126, 187, 83)'
1050   - // });
1051   -
1052   - // clickedPin.fillStyle = radialAfterClick;
1053   -
1054   - // var pinID = (clickedPin.name).substring(7, (clickedPin.name).length);
1055   - // // alert('pinId: ' + pinID);
1056   - // //showAnnotation();
1057   -
1058   - // var pinData = new jinqJs()
1059   - // .from($scope.aaPinData)
1060   - // .where("_PinId == " + pinID)
1061   - // .select();
1062   -
1063   -
1064   - // var pinTermNumber = pinData[0]._TermId;
1065   -
1066   - // var pinWithSameTerm = new jinqJs()
1067   -
1068   - // .from($scope.aaPinData)
1069   - // .where("_TermId == " + pinTermNumber)
1070   - // .select();
1071   -
1072   -
1073   - // if (pinWithSameTerm != undefined && pinWithSameTerm != null && pinWithSameTerm.length > 0) {
1074   -
1075   - // for (var i = 0; i < pinWithSameTerm.length; i++) {
1076   -
1077   - // $scope.clickedPins.push({ 'id': pinWithSameTerm[i]._PinId })
1078   - // }
1079   -
1080   - // }
1081   -
1082   - // var selectedPinData = new jinqJs()
1083   - // .from($scope.aaPinData)
1084   - // .where("_PinId == " + pinID)
1085   - // .select();
1086   - // if (clickedPin.event.ctrlKey == true) {
1087   - // $scope.showAnnotation(selectedPinData, true, true, false);
1088   -
1089   - // }
1090   - // else {
1091   - // $scope.showAnnotation(selectedPinData, false, true, false);
1092   -
1093   - // }
1094   -
1095   -
1096   - // }
1097   -
1098   - // }).drawLayers();
1099   - //}
1100   -
  1012 +
1101 1013 }
1102 1014  
1103 1015  
... ... @@ -1118,8 +1030,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1118 1030  
1119 1031 $scope.removeSpeechBubble();
1120 1032  
1121   - //$rootScope.isSliderChanged = true;
1122   - //$('#aaDetailViewCanvas').removeLayers();
  1033 +
1123 1034 }
1124 1035  
1125 1036 $rootScope.$on('annotationToolEvent', function (event, data) {
... ... @@ -1304,7 +1215,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1304 1215 })
1305 1216 angular.forEach($scope.clickedPins, function (value1, key1) {
1306 1217  
1307   - // if (aaPinDataValue._PinId != value.id) {
  1218 +
1308 1219 var pinName = 'Pin_' + value1.id;
1309 1220 var pinArcName = 'PinArc_' + value1.id;
1310 1221  
... ... @@ -1315,27 +1226,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1315 1226 $('#aaDetailViewCanvas').setLayer(pinArcName, {
1316 1227 visible: true // set to true instead to show the layer again
1317 1228 }).drawLayers();
1318   - // }
  1229 +
1319 1230 })
1320 1231  
1321 1232 angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) {
1322 1233  
1323   - // if (aaPinDataValue._PinId != value.id) {
  1234 +
1324 1235 var pinName = 'Pin_' + aaPinDataValue._PinId;
1325 1236 var pinArcName = 'PinArc_' + aaPinDataValue._PinId;
1326 1237  
1327 1238 $('#aaDetailViewCanvas').setLayer(pinName, {
1328   - visible: false // set to true instead to show the layer again
  1239 + visible: false
1329 1240 }).drawLayers();
1330 1241  
1331 1242 $('#aaDetailViewCanvas').setLayer(pinArcName, {
1332   - visible: false // set to true instead to show the layer again
  1243 + visible: false
1333 1244 }).drawLayers();
1334   - // }
  1245 +
1335 1246 })
1336 1247  
1337   - // })
1338   - // $scope.clickedPins = [];
1339 1248 }
1340 1249  
1341 1250 else {
... ... @@ -1345,11 +1254,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1345 1254 var pinArcName = 'PinArc_' + aaPinDataValue._PinId;
1346 1255  
1347 1256 $('#aaDetailViewCanvas').setLayer(pinName, {
1348   - visible: true // set to true instead to show the layer again
  1257 + visible: true
1349 1258 }).drawLayers();
1350 1259  
1351 1260 $('#aaDetailViewCanvas').setLayer(pinArcName, {
1352   - visible: true // set to true instead to show the layer again
  1261 + visible: true
1353 1262 }).drawLayers();
1354 1263 })
1355 1264 }
... ... @@ -1526,30 +1435,10 @@ function showSelectedPins(event) {
1526 1435 });
1527 1436 }
1528 1437  
1529   -function onZoom(scope) {
1530   -
1531   - //$(".common-drag").remove();
1532   - //$(".commonDot").remove();
1533   - //$(".commonDraggedLine").remove();
1534   - //var radial = $('#aaDetailViewCanvas').createGradient({
1535   - // x1: 50, y1: 50,
1536   - // x2: 50, y2: 50,
1537   - // r1: 10, r2: 30,
1538   - // c1: 'rgba(100, 50, 0,0)',
1539   - // c2: 'rgb(216, 216, 216)'
1540   - //});
1541   - //$('#aaDetailViewCanvas').setLayers({
1542   - // fillStyle: radial,
1543   - //}).drawLayers();
1544   - // scope.removePin();
1545   - // scope.showAllPins();
1546   -
1547   -
1548   - //6. Show all pins on AA opened item
1549   -}
1550   -
1551 1438  
1552 1439 $(document).ready(function () {
  1440 +
  1441 + //for zoom
1553 1442 $(".slider").slider({
1554 1443 min: 25,
1555 1444 max: 100,
... ... @@ -1558,8 +1447,6 @@ $(document).ready(function () {
1558 1447 orientation: "vertical",
1559 1448 slide: function (event, ui) {
1560 1449  
1561   -
1562   -
1563 1450 var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
1564 1451 scope.$apply(function () {
1565 1452 scope.sliderVal = ui.value;
... ...