diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index bd935b6..ccb10f2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -1115,11 +1115,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.jsPanelID = 'aiImagePanel' + '_' + windowviewid; - var selectedCIImage = $scope.GetAIwindowStoreData(windowviewid, 'AIImagePath'); + var selectedAIImage = $scope.GetAIwindowStoreData(windowviewid, 'AIImagePath'); var tittle = $scope.GetAIwindowStoreData(windowviewid, 'currentViewTitle'); - var imageId = $scope.GetAIwindowStoreData(windowviewid, 'imageId'); - + if ($rootScope.isCallFromOtherModule) { // open JS panel for curriculum with define cornonate in CB jason $scope.jsPanelWidth = $scope.aiOpenInOtherModules.size.width;//1000; @@ -1139,23 +1138,25 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { $scope.jsPanelWidth = $(window).outerWidth() - 30; - $scope.jsPanelHeight = $(window).outerHeight() - 125; + $scope.jsPanelHeight = $(window).outerHeight() - 150; $scope.jsPanelLeft = 15; $scope.jsPanelTop = 70; } - if (selectedCIImage.length > 0) { + if (selectedAIImage.length > 0) { $scope.jsPanelAI = $.jsPanel({ id: $scope.jsPanelID, selector: '.aiView', theme: 'success', currentController: 'AIController', parentSlug: $scope.GetAIwindowStoreData(windowviewid, 'parentSlugName'), - content: '
' + - '
' + - '' + - - '
', + content: '
'+ + '
'+ + '
'+ + '
' + + '' + + '
'+ + '
', title: tittle, position: { @@ -1201,6 +1202,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetAIwindowStoreData(windowviewid, 'width', ui.size.width); $scope.SetAIwindowStoreData(windowviewid, 'height', ui.size.height); $rootScope.UnsaveCurriculum = true; + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight); } }, @@ -1216,7 +1219,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }); - $('#canvasDivAI_' + windowviewid + ' img').load(function () { var isMaximize = $scope.GetAIwindowStoreData(windowviewid, 'maximised'); var isMinimize = $scope.GetAIwindowStoreData(windowviewid, 'minimised'); if (isMaximize) { @@ -1234,53 +1236,67 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetAIwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft); $scope.SetAIwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); $scope.SetAIwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); - $scope.EnableUI(); - $scope.JsPanelclick(windowviewid); - var canvas = document.getElementById("canvasAI_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintAI_" + windowviewid); - - var canvasDIvHeight = $("#" + $scope.jsPanelID + " .jsPanel-content").height(); - - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight); - $("#" + $scope.jsPanelID + " .img-thumbnail").css("height", canvasDIvHeight); - - canvas.height = canvasDIvHeight; - canvasPaint.height = canvasDIvHeight; - if ($rootScope.isCallFromOtherModule) { - var annotationData= $scope.aiOpenInOtherModules.annotationData; - // load annotation - if(annotationData!="" && annotationData!=undefined) - { - if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { - //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasAI_"+windowviewid,"canvasPaintAI_"+windowviewid,annotationData); - } - } - - } - $rootScope.AIWindowLoadComplete = true; - }); - - $scope.SetAIwindowStoreData(windowviewid, 'currentSlug', 'adam-images-detail'); - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": imageId, - "slug": $scope.GetAIwindowStoreData(windowviewid, 'currentSlug') - }); - - + $timeout(function () { + $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') - + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); // console.log($rootScope.OpenAdamImages); $('#AIView').css("height", $(window).outerHeight() - 65); $('#AIView').css("width", $(window).outerWidth() - 15); + + $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight); + + if (!$rootScope.isCallFromOtherModule) { + var canvas = document.getElementById("canvasAI_" + windowviewid); + var canvasPaint = document.getElementById("canvasPaintAI_" + windowviewid); + + canvas.height = canvasDIvHeight-20; + canvasPaint.height = canvasDIvHeight-20; + canvas.width = screen.width-70; + canvasPaint.width = screen.width-70; + } + + $scope.SetAIwindowStoreData(windowviewid, 'currentSlug', 'adam-images-detail'); + var openedImage = document.getElementById('aimage_' + windowviewid ); + openedImage.src = selectedAIImage; + openedImage.onload = function () { + if (!$rootScope.isCallFromOtherModule) { + $("#aimage_"+windowviewid).css("left", (screen.width-this.width-70)/2 + "px"); + } + $("#aimage_"+windowviewid).css("visibility","visible"); + // $("#aimage_"+windowviewid).css("width", this.width + "px"); + // $("#aimage_"+windowviewid).css("height", this.height + "px"); + + + $scope.JsPanelclick(windowviewid); + + if ($rootScope.isCallFromOtherModule) { + var annotationData= $scope.aiOpenInOtherModules.annotationData; + // load annotation + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + //first draw shape and then store in object + $rootScope.LoadCBSavedAnnotation("canvasAI_"+windowviewid,"canvasPaintAI_"+windowviewid,annotationData); + } + } + + } + + $scope.EnableUI(); + $rootScope.AIWindowLoadComplete = true; + }; + + $scope.PanelActivity(); + + },300) } - $scope.PanelActivity(); + } $rootScope.aiAnnotationToolEvent = function (windowviewid) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 52f1a12..57e9750 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -938,7 +938,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout currentController: 'CAController', parentSlug: $scope.GetCAwindowStoreData(windowviewid, 'parentSlugName'), content: '' + - '