diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 482ae84..85fc1e0 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -775,7 +775,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.isBodySystemSelected = false; $scope.SelectedSystemTitle = "Current Structure"; $scope.showSelectedSystemPins = function (event) { - + if (typeof event == "object") { if (event.currentTarget.title == $("#bodySystemList li.activeAASystemSelect a").attr("title")) { @@ -821,11 +821,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou else { $scope.selectedSystemName = $scope.SelectedSystemTitle; + // get termText info var promise = ModuleService.getTermTextDataForPin($scope.moduleName) .then( function (response) { - + $scope.TermInfo = response.data.Terms.Term; //on gettng all required data, draw pins @@ -893,6 +894,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou { $scope.SelectedSystemID = event; $scope.SelectedSystemTitle = $("#bodySystemList li.activeAASystemSelect a").attr("title"); + $scope.typeOfEvent = typeof event; // $scope.isBodySystemSelected = true; $rootScope.isShowSelectedSystemPinsClicked = true; @@ -919,8 +921,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } else { - + $scope.selectedSystemName = $scope.SelectedSystemTitle; + // get termText info var promise = ModuleService.getTermTextDataForPin($scope.moduleName) .then( @@ -934,6 +937,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou .from($scope.aaPinData) .where("_BodySystemName == " + $scope.selectedSystemName) .select(); + + console.log($scope.selectedSystemPinData); + if ($scope.isHidePinBtnClicked) { // $scope.showAllPinsAfterHide($scope.selectedSystemPinData); $scope.showAllPinsAfterHide(); @@ -973,11 +979,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.activePinArray = []; $scope.isSearchOptionClicked = false; $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked, isItemSearched) { - + $scope.selectedPin = []; var isSameTermWithMultiPin = false; - var firstPinId = selectedPinData[0]._PinId; - var pinTermNumber = selectedPinData[0]._TermId; + + var firstPinId = selectedPinData[0]._PinId; + var pinTermNumber = selectedPinData[0]._TermId; //check if other pin have same termNumber if ($scope.aaPinData != null && $scope.aaPinData.length > 0) { @@ -987,11 +994,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou .where("_TermId == " + pinTermNumber) .select(); - //if ($scope.isSearchOptionClicked == true) { - // $scope.activePinArray = []; - // $scope.clickedPins = []; - // $scope.isSearchOptionClicked = false; - //} + if ($scope.isBodySystemSelected == true) { $scope.isSelectedSystemSelectedAftrChange = true; @@ -1161,6 +1164,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $scope.sliderVal = 100; $scope.createSpeechBubbleBasedOnAnnotationLength = function (x, y, PinId) { + x = x * $scope.sliderPercentValue; y = y * $scope.sliderPercentValue; if ($("#canvasDiv").find("div").length > 0) { @@ -2003,7 +2007,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }, 1000); } - + $scope.highlightPinBasedOnSerachItem = function (id) { $scope.isSelectedSystemSelectedAftrChange = false; @@ -2011,10 +2015,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.listMangerID = []; $scope.searchItemId = id; - $scope.searchItemText = $("#" + id).val(); + $scope.searchItemText = $("#" + id).val(); $rootScope.searchSelectedText = $("#" + id).val(); $('#termList option[selected="selected"]').prop("selected", false); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); @@ -2024,13 +2029,45 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //selectedTermName.placeholder = $("#" + id).text(); selectedTermName.value = $("#" + id).val(); selectedTermName.placeholder = "search... "; - - //get data from pindata for this trem + if ($("#bodySystemList li.activeAASystemSelect a").attr("id") == 0) { + // alert("All"); + } + else + { + $("#bodySystemList li").each(function () { + if ($(this).hasClass("disabledSelectedSystem") || $(this).hasClass("divider") || ($(this).find("a").attr("id") == 0)) { + } + else { + var promise = ModuleService.getTermTextDataForPin($scope.moduleName) + .then( + function (response) { + $scope.ListManagerTermInfo = response.data.Terms.Term; + $rootScope.selectedSystemList = $('#termList option[id="' + id + '"]').text(); + $scope.selectedSystemPinDataForList = new jinqJs() + .from($scope.ListManagerTermInfo) + .where("__TermText == " + $('#termList option[id="' + id + '"]').text()) + .select(); + $scope.showSelectedSystemPins($scope.selectedSystemPinDataForList[0].__BodySystemId); + }, + function (error) { + // handle errors here + console.log(' error: ' + error.statusText); + } + ) + } + + }); + } + + + //get data from pindata for this trem + var pinDataForTerm = new jinqJs() .from($scope.aaPinData) .where("_TermId == " + $scope.searchItemId) .select(); + $timeout(function () { //make all pin heads grey var radial = $('#aaDetailViewCanvas').createGradient({ x1: 50, y1: 50, @@ -2039,11 +2076,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou c1: 'rgba(100, 50, 0,0)', c2: 'rgb(216, 216, 216)' }); - - $('#aaDetailViewCanvas').setLayers({ fillStyle: radial, }).drawLayers(); + console.log(pinDataForTerm[0]._PinId); $scope.clickedPins = []; $scope.clickedPins.push({ 'id': pinDataForTerm[0]._PinId }); @@ -2051,9 +2087,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var pinID = "PinArc_" + pinDataForTerm[0]._PinId; $scope.activePinArray.push({ 'id': pinID }); $scope.showAnnotation(pinDataForTerm, false, false, true); - // maintaing scroll position on selection of options in list manager. + // maintaing scroll position on selection of options in list manager. var annotationTopPos = $(".common-drag").css("top").split("p"); $("#canvasDiv").scrollTop(annotationTopPos[0]); + }, 700); + $scope.IsSearchVisible = false; }