diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index cac3cfc..269abe9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -2581,77 +2581,87 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo + ''; - $('#canvasDiv').append(sppechBubbleDotHTML); - if ($scope.MultiLanguageAnnationArray.length > 0) { - for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { - var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; - $("#sppeachBubble").append("

" + MultipleLanguage + "

"); - } - } - else { - console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length) + //Issue #7286 :Undefined annotation should not appear + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { + var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; } - if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { - if ($scope.longestAnnotation.length <= 10) { - - $("#sppeachBubble").css("width", "100px"); + if (MultipleLanguage == undefined) { + console.log("No text is found"); + } else { + $('#canvasDiv').append(sppechBubbleDotHTML); + if ($scope.MultiLanguageAnnationArray.length > 0) { + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { + var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; + $("#sppeachBubble").append("

" + MultipleLanguage + "

"); + } + } + else { + console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length) } + if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { + if ($scope.longestAnnotation.length <= 10) { - else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { + $("#sppeachBubble").css("width", "100px"); + } - $("#sppeachBubble").css("width", "140px"); + else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { - } - else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { - $("#sppeachBubble").css("width", "195px"); + $("#sppeachBubble").css("width", "140px"); - } - else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { + } + else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { - $("#sppeachBubble").css("width", "248px"); - } - else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { + $("#sppeachBubble").css("width", "195px"); + } + else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { - $("#sppeachBubble").css("width", "300px"); - } + $("#sppeachBubble").css("width", "248px"); - else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { + } + else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { - $("#sppeachBubble").css("width", "370px"); - } + $("#sppeachBubble").css("width", "300px"); + } - else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { + else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { + $("#sppeachBubble").css("width", "370px"); - $("#sppeachBubble").css("width", "450px"); + } - } + else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { - else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { + $("#sppeachBubble").css("width", "450px"); - $("#sppeachBubble").css("width", "510px"); + } - } + else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { - else { + $("#sppeachBubble").css("width", "510px"); - $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%"); + } + else { - } + $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%"); + + + } + + } } var Globe = []; Globe.push({ currentX: x, currentY: y }); @@ -3139,44 +3149,54 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) { var sppechBubbleHTML = "
"; - $("#canvasDiv").append(sppechBubbleHTML); - + //Issue #7286 :Undefined annotation should not appear for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { var annotation = $scope.MultiLanguageAnnationArray[i]; - - $("#" + id).append("

" + annotation + "

"); } - if ($scope.longestAnnotation.length <= 10) { - $("#" + id).css("width", "100px"); - } + if (annotation == undefined) { + console.log("No text found"); + } else { - else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { - $("#" + id).css("width", "140px"); - } - else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { - $("#" + id).css("width", "195px"); + $("#canvasDiv").append(sppechBubbleHTML); - } - else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { - $("#" + id).css("width", "248px"); - } - else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { - $("#" + id).css("width", "300px"); - } + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { + var annotation = $scope.MultiLanguageAnnationArray[i]; - else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { - $("#" + id).css("width", "370px"); - } - else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { - $("#" + id).css("width", "450px"); - } - else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { - $("#" + id).css("width", "510px"); + $("#" + id).append("

" + annotation + "

"); + } - } - else { - $("#" + id).css("width", ($scope.longestAnnotation.length) + "%"); + if ($scope.longestAnnotation.length <= 10) { + $("#" + id).css("width", "100px"); + } + + else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { + $("#" + id).css("width", "140px"); + } + else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { + $("#" + id).css("width", "195px"); + + } + else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { + $("#" + id).css("width", "248px"); + } + else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { + $("#" + id).css("width", "300px"); + } + + else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { + $("#" + id).css("width", "370px"); + } + else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { + $("#" + id).css("width", "450px"); + } + else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { + $("#" + id).css("width", "510px"); + + } + else { + $("#" + id).css("width", ($scope.longestAnnotation.length) + "%"); + } } }