From c6d78f134b23bbb709271846fa2dfcc89ecdbabf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Sep 2017 12:36:18 +0530 Subject: [PATCH] Commit Changes --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 10 +++++----- 2 files changed, 69 insertions(+), 39 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 47919e3..1e3b7fb 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -941,7 +941,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic a = parseInt(a) + 1; $("#aaDetailViewCanvas").css("z-index", a); } - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) { @@ -960,6 +959,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }).drawLayers(); } + } } @@ -2330,6 +2330,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); if ($location.path() == "/module-item-view") { + $rootScope.initialTextAreaName = layer.name; $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height }); } @@ -2739,8 +2740,24 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic document.getElementById('modelbackground').style.display = "none"; $rootScope.selectedBGColorForTextArea = $("#drawTextBGColorpicker span.minicolors-swatch-color").css('background-color'); + + + // this part will work first time when save button will be clicked if ($rootScope.IsTextAlreadySave == false) { + + + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == $rootScope.initialTextAreaName) { + $rootScope.jcanvasObjectArray.splice(i, 1); + $rootScope.initialTextAreaName = ''; + } + } + } + + + // getting textarea style properties $rootScope.fontSizes = $("#text_area").css("font-size"); $rootScope.fontWeight = $("#text_area").css("font-weight"); @@ -2777,6 +2794,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_"); $rootScope.postFixLayerNumber = TextAreaLayerNameAftrSplit[1]; if ($location.path() == "/module-item-view") { + $rootScope.initialTextAreaName = layer.name; $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height }); } }, @@ -2815,7 +2833,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic width: 10, height: 10, cornerRadius: 3, click: function () { - debugger; if ($location.path() == "/module-item-view") { $rootScope.isRectangleInAAClicked = true; } @@ -3009,7 +3026,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic width: 10, height: 10, cornerRadius: 3, click: function () { - debugger $rootScope.isTextAReaRectangleClicked = true; if ($location.path() == "/module-item-view") { $rootScope.isRectangleInAAClicked = true; @@ -3040,24 +3056,28 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic //} $rootScope.textXAxisAftrResize = layer.x; $rootScope.textYAxisAftrResize = layer.y; - } - } - if ($location.path() == "/module-item-view") { - - if ($rootScope.isRectangleInAAClicked == true) { - $rootScope.isRectangleInAAClicked = false; - debugger; - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { - if ($rootScope.jcanvasObjectArray[i].name == layer.name) { - $rootScope.jcanvasObjectArray[i].x = layer.x; - $rootScope.jcanvasObjectArray[i].y = layer.y; - $rootScope.jcanvasObjectArray[i].width = layer.width; - $rootScope.jcanvasObjectArray[i].height = layer.height; + + if ($location.path() == "/module-item-view") { + + if ($rootScope.isRectangleInAAClicked == true) { + $rootScope.isRectangleInAAClicked = false; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } } } + + } } + + } }).drawText({ @@ -3117,6 +3137,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic // this part will work second time when save button will be clicked else { + + if ($location.path() == "/module-item-view") { + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == $rootScope.initialTextAreaName) { + $rootScope.jcanvasObjectArray.splice(i, 1); + $rootScope.initialTextAreaName = ''; + } + } + } + + // getting textarea style properties var _modifiedText = $("#text_area").val(); var _modifiedFontSize = $("#text_area").css("font-size"); @@ -3196,8 +3227,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic width: 10, height: 10, cornerRadius: 3, click: function () { - debugger; - if ($location.path() == "/module-item-view") { $rootScope.isRectangleInAAClicked = true; } @@ -3347,7 +3376,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic click: function () { $rootScope.isTextAReaRectangleClickedAftrEdit = true; if ($location.path() == "/module-item-view") { - debugger; $rootScope.isRectangleInAAClicked = true; } } @@ -3379,25 +3407,27 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.editTextXAxisAftrResize = layer.x; $rootScope.editTextYAxisAftrResize = layer.y; - - } - } - - if ($location.path() == "/module-item-view") { - - if ($rootScope.isRectangleInAAClicked == true) { - $rootScope.isRectangleInAAClicked = false; - debugger; - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { - if ($rootScope.jcanvasObjectArray[i].name == layer.name) { - $rootScope.jcanvasObjectArray[i].x = layer.x; - $rootScope.jcanvasObjectArray[i].y = layer.y; - $rootScope.jcanvasObjectArray[i].width = layer.width; - $rootScope.jcanvasObjectArray[i].height = layer.height; + + if ($location.path() == "/module-item-view") { + + if ($rootScope.isRectangleInAAClicked == true) { + $rootScope.isRectangleInAAClicked = false; + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) { + if ($rootScope.jcanvasObjectArray[i].name == layer.name) { + $rootScope.jcanvasObjectArray[i].x = layer.x; + $rootScope.jcanvasObjectArray[i].y = layer.y; + $rootScope.jcanvasObjectArray[i].width = layer.width; + $rootScope.jcanvasObjectArray[i].height = layer.height; + } + } } } + + } } + + } }).drawText({ diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index ff4b85d..f72c8b4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -372,7 +372,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }); }) - + $rootScope.aaPinDataArray = []; $scope.showAllPins = function () { $scope.allPinDataArray = []; @@ -394,7 +394,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //draw pins $scope.aaPinData = result.data.Root.Item; if ($scope.aaPinData != null && $scope.aaPinData.length > 0) { - + $rootScope.aaPinDataArray = $scope.aaPinData angular.forEach($scope.aaPinData, function (value, key) { $scope.allPinDataArray.push(value._PinId); $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) @@ -885,12 +885,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou x = x * $scope.sliderPercentValue; y = y * $scope.sliderPercentValue; - var speechBubbleHTML = '' - + '
' + var speechBubbleHTML = '' + + '
' + '' + '
' - + '