Commit bfca2cb957fff90e87f871824212c3ba7171fb79
1 parent
1310aae7
Showing
1 changed file
with
87 additions
and
67 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -2581,77 +2581,87 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2581 | 2581 | |
2582 | 2582 | + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord">' |
2583 | 2583 | + '</div>'; |
2584 | - $('#canvasDiv').append(sppechBubbleDotHTML); | |
2585 | 2584 | |
2586 | - if ($scope.MultiLanguageAnnationArray.length > 0) { | |
2587 | - for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
2588 | - var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; | |
2589 | - $("#sppeachBubble").append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>"); | |
2590 | - } | |
2591 | - } | |
2592 | - else { | |
2593 | - console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length) | |
2585 | + //Issue #7286 :Undefined annotation should not appear | |
2586 | + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
2587 | + var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; | |
2594 | 2588 | } |
2595 | - if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { | |
2596 | - if ($scope.longestAnnotation.length <= 10) { | |
2597 | - | |
2598 | 2589 | |
2599 | - $("#sppeachBubble").css("width", "100px"); | |
2590 | + if (MultipleLanguage == undefined) { | |
2591 | + console.log("No text is found"); | |
2592 | + } else { | |
2593 | + $('#canvasDiv').append(sppechBubbleDotHTML); | |
2600 | 2594 | |
2595 | + if ($scope.MultiLanguageAnnationArray.length > 0) { | |
2596 | + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
2597 | + var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; | |
2598 | + $("#sppeachBubble").append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>"); | |
2599 | + } | |
2600 | + } | |
2601 | + else { | |
2602 | + console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length) | |
2601 | 2603 | } |
2604 | + if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { | |
2605 | + if ($scope.longestAnnotation.length <= 10) { | |
2602 | 2606 | |
2603 | - else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { | |
2604 | 2607 | |
2608 | + $("#sppeachBubble").css("width", "100px"); | |
2605 | 2609 | |
2610 | + } | |
2606 | 2611 | |
2607 | - $("#sppeachBubble").css("width", "140px"); | |
2612 | + else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { | |
2608 | 2613 | |
2609 | - } | |
2610 | - else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { | |
2611 | 2614 | |
2612 | 2615 | |
2613 | - $("#sppeachBubble").css("width", "195px"); | |
2616 | + $("#sppeachBubble").css("width", "140px"); | |
2614 | 2617 | |
2615 | - } | |
2616 | - else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { | |
2618 | + } | |
2619 | + else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { | |
2617 | 2620 | |
2618 | - $("#sppeachBubble").css("width", "248px"); | |
2619 | 2621 | |
2620 | - } | |
2621 | - else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { | |
2622 | + $("#sppeachBubble").css("width", "195px"); | |
2622 | 2623 | |
2624 | + } | |
2625 | + else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { | |
2623 | 2626 | |
2624 | - $("#sppeachBubble").css("width", "300px"); | |
2625 | - } | |
2627 | + $("#sppeachBubble").css("width", "248px"); | |
2626 | 2628 | |
2627 | - else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { | |
2629 | + } | |
2630 | + else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { | |
2628 | 2631 | |
2629 | - $("#sppeachBubble").css("width", "370px"); | |
2630 | 2632 | |
2631 | - } | |
2633 | + $("#sppeachBubble").css("width", "300px"); | |
2634 | + } | |
2632 | 2635 | |
2633 | - else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { | |
2636 | + else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { | |
2634 | 2637 | |
2638 | + $("#sppeachBubble").css("width", "370px"); | |
2635 | 2639 | |
2636 | - $("#sppeachBubble").css("width", "450px"); | |
2640 | + } | |
2637 | 2641 | |
2638 | - } | |
2642 | + else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { | |
2639 | 2643 | |
2640 | - else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { | |
2641 | 2644 | |
2645 | + $("#sppeachBubble").css("width", "450px"); | |
2642 | 2646 | |
2643 | - $("#sppeachBubble").css("width", "510px"); | |
2647 | + } | |
2644 | 2648 | |
2645 | - } | |
2649 | + else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { | |
2646 | 2650 | |
2647 | - else { | |
2648 | 2651 | |
2652 | + $("#sppeachBubble").css("width", "510px"); | |
2649 | 2653 | |
2650 | - $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%"); | |
2654 | + } | |
2651 | 2655 | |
2656 | + else { | |
2652 | 2657 | |
2653 | - } | |
2654 | 2658 | |
2659 | + $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%"); | |
2660 | + | |
2661 | + | |
2662 | + } | |
2663 | + | |
2664 | + } | |
2655 | 2665 | } |
2656 | 2666 | var Globe = []; |
2657 | 2667 | Globe.push({ currentX: x, currentY: y }); |
... | ... | @@ -3139,44 +3149,54 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3139 | 3149 | |
3140 | 3150 | $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) { |
3141 | 3151 | var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com'><div style='z-index:10000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.speechBubbleCounter + "'></div><div data=" + $scope.speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#000;text-align:left;font-size: 12px;background-color:#fff;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.speechBubbleCounter + " class='dynCross' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.speechBubbleCounter + "'></div></div>"; |
3142 | - $("#canvasDiv").append(sppechBubbleHTML); | |
3143 | - | |
3152 | + //Issue #7286 :Undefined annotation should not appear | |
3144 | 3153 | for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { |
3145 | 3154 | var annotation = $scope.MultiLanguageAnnationArray[i]; |
3146 | - | |
3147 | - $("#" + id).append("<p style='margin-bottom:2px;'>" + annotation + "</p>"); | |
3148 | 3155 | } |
3149 | 3156 | |
3150 | - if ($scope.longestAnnotation.length <= 10) { | |
3151 | - $("#" + id).css("width", "100px"); | |
3152 | - } | |
3157 | + if (annotation == undefined) { | |
3158 | + console.log("No text found"); | |
3159 | + } else { | |
3153 | 3160 | |
3154 | - else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { | |
3155 | - $("#" + id).css("width", "140px"); | |
3156 | - } | |
3157 | - else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { | |
3158 | - $("#" + id).css("width", "195px"); | |
3161 | + $("#canvasDiv").append(sppechBubbleHTML); | |
3159 | 3162 | |
3160 | - } | |
3161 | - else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { | |
3162 | - $("#" + id).css("width", "248px"); | |
3163 | - } | |
3164 | - else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { | |
3165 | - $("#" + id).css("width", "300px"); | |
3166 | - } | |
3163 | + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { | |
3164 | + var annotation = $scope.MultiLanguageAnnationArray[i]; | |
3167 | 3165 | |
3168 | - else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { | |
3169 | - $("#" + id).css("width", "370px"); | |
3170 | - } | |
3171 | - else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { | |
3172 | - $("#" + id).css("width", "450px"); | |
3173 | - } | |
3174 | - else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { | |
3175 | - $("#" + id).css("width", "510px"); | |
3166 | + $("#" + id).append("<p style='margin-bottom:2px;'>" + annotation + "</p>"); | |
3167 | + } | |
3176 | 3168 | |
3177 | - } | |
3178 | - else { | |
3179 | - $("#" + id).css("width", ($scope.longestAnnotation.length) + "%"); | |
3169 | + if ($scope.longestAnnotation.length <= 10) { | |
3170 | + $("#" + id).css("width", "100px"); | |
3171 | + } | |
3172 | + | |
3173 | + else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { | |
3174 | + $("#" + id).css("width", "140px"); | |
3175 | + } | |
3176 | + else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { | |
3177 | + $("#" + id).css("width", "195px"); | |
3178 | + | |
3179 | + } | |
3180 | + else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { | |
3181 | + $("#" + id).css("width", "248px"); | |
3182 | + } | |
3183 | + else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { | |
3184 | + $("#" + id).css("width", "300px"); | |
3185 | + } | |
3186 | + | |
3187 | + else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { | |
3188 | + $("#" + id).css("width", "370px"); | |
3189 | + } | |
3190 | + else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { | |
3191 | + $("#" + id).css("width", "450px"); | |
3192 | + } | |
3193 | + else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { | |
3194 | + $("#" + id).css("width", "510px"); | |
3195 | + | |
3196 | + } | |
3197 | + else { | |
3198 | + $("#" + id).css("width", ($scope.longestAnnotation.length) + "%"); | |
3199 | + } | |
3180 | 3200 | } |
3181 | 3201 | } |
3182 | 3202 | ... | ... |