From 54e1c49e7e928f81501e70535d4db62fd1d398e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jan 2017 17:11:49 +0530 Subject: [PATCH] commit changes for Bug #12596:DA > Annotation Toolbar > If Fill Option and Outline option are unchecked and user click on Cancel button. Changes should be discard. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 35 ++++++++++++++++++++++++++++++----- 400-SOURCECODE/AIAHTML5.Web/index.html | 6 +++--- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 9a69c4e..cf4850a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -461,9 +461,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //$rootScope.switchCanvasToPaintCanvas(); } - + $rootScope.isShapeSyleOkBtnClicked = false; $rootScope.setPropertiesForShapes = function (id) { - + $rootScope.isShapeSyleOkBtnClicked = true; if ((document.getElementById('fill-option').checked == false) && (document.getElementById('Outline-Option').checked == false)) { // $('#btnShapeStyle').attr('disabled', 'disabled'); @@ -532,9 +532,34 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.disableAnnotationToolBar = function () { - - $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)"); - $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(0,0,0)"); + if ($rootScope.isShapeSyleOkBtnClicked == false) { + $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)"); + $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(0,0,0)"); + var previewBorderColor = $("#outlineColor span.minicolors-swatch-color").css('background-color'); + $(".marginTopBtm10 div.outlinediv").css("border-color", previewBorderColor); + var previewBgColor = $("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color'); + $("#imgOpacity").css("background-color", previewBgColor); + $('#borderWidthCanvasElement').val(1); + $('.marginTopBtm10 div.outlinediv').css("border-width", 1); + $("#imgOpacity").css("opacity", 1); + $(".marginTopBtm10 div.outlinediv").css("opacity", 1); + //$("#borderWidthCanvasElement").change(function () { + // $(".marginTopBtm10 div.outlinediv").css("border-color", x); + //}); + } else { + var previewBgColor = $("#shapeStyleDiv").css('background-color'); + var previewBorderColor = $('#previewBorder').css('border-color'); + var previewBorderWidth = $('#previewBorder').css('border-width'); + var previewOpacity = $('#previewBorder').css('opacity'); + $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", previewBgColor); + $("#imgOpacity").css("background-color", previewBgColor); + $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", previewBorderColor); + $(".marginTopBtm10 div.outlinediv").css("border-color", previewBorderColor); + $('.marginTopBtm10 div.outlinediv').css("border-width", previewBorderWidth); + $('#borderWidthCanvasElement').val(previewBorderWidth.split("px")); + $("#imgOpacity").css("opacity", previewOpacity); + $(".marginTopBtm10 div.outlinediv").css("opacity", previewOpacity); + } document.getElementById('modelbackground').style.display = "none"; document.getElementById('modeleditstyle').style.display = "none"; //Edit Shape Style popup should open at it's default position diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index e3bf9ff..4109392 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -524,7 +524,7 @@ -
+
@@ -1436,9 +1436,9 @@ var borderWidth = 1; var borderColor = "#000"; $("#borderWidthCanvasElement").change(function () { - borderWidth = $(this).val(); - + borderColor = $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color"); + if (borderColor != null) { document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor; //$("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid" + borderColor); -- libgit2 0.21.4