Merged
Merge Request #950 · created by Mangaldeep Patel


Aiahtml bug388174


From AIAHTML_BUG388174 into Develop

Merged by Nikita Kulshreshtha

2 participants


400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... ... @@ -341,6 +341,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
341 341 $('table > #ListViewDiv > #searchItem').remove();
342 342  
343 343 $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>');
  344 + localStorage.setItem("SearchText", '');
344 345 }
345 346 $rootScope.isLoading = false;
346 347 $('#spinner').css('visibility', 'hidden');
... ... @@ -491,7 +492,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
491 492 if ($rootScope.refreshcheck == null) {
492 493 $location.path('/');
493 494 }
494   -
495 495 $rootScope.isLoading = true;
496 496 $('#spinner').css('visibility', 'visible');
497 497 $scope.voId = $rootScope.getLocalStorageValue("currentAIImageId");
... ... @@ -513,17 +513,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
513 513 .select('_contentImage');
514 514  
515 515 $scope.clickedAIImage = "~/../content/images/ai/images/" + clickedAIImage[0]._contentImage;
  516 +
516 517 if (clickedAIImage.length > 0) {
  518 +
517 519 $.jsPanel({
518 520 id: 'aiImagePanel',
519 521 selector: '.aiView',
520 522 theme: 'success',
521 523 currentController: 'AIController',
522 524 parentSlug: 'ADAM-images',
523   - content: '<div class="row" id="canvasDiv"><div style="align:left;"><canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="1369" height="325" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1 "></canvas> <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="1369" height="325" class="canvas-annotationStyle1" style="position: absolute;z-index:0;"></canvas></div>' +
  525 + content: '<div class="row" id="canvasDiv"><div style="align:left;"><canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="1369" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1 "></canvas> <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="1369" class="canvas-annotationStyle1" style="position: absolute;z-index:0;"></canvas></div>' +
524 526 '<div class="col-sm-12 img-thumbnail" align="center">' +
525 527 '<img src="' + $scope.clickedAIImage + '" alt="" title="" class="img-responsive ">' +
526   - '<script>$(document).ready(function(){ var $ua = navigator.userAgent;if(($ua.match(/(iPod|iPhone|iPad|android)/i))) { var jspanelContainerWidth = $(".jsPanel-content").css("width"); $(".jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });$("#aiImagePanel").css("width", "100%"); }$("#btnTxtOnOff").click(function(){if($.trim($(this).text()) === "Text Off"){$(this).text("Text On");$("#sid").css("visibility","hidden");}else{$(this).text("Text Off");$("#sid").css("visibility","visible");}});});</script></div>' +
  528 + '<script>$(document).ready(function(){ var $ua = navigator.userAgent;if(($ua.match(/(iPod|iPhone|iPad|android)/i))) { var jspanelContainerWidth = $(".jsPanel-content").css("width"); $(".jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });$("#aiImagePanel").css("width", "100%"); }$("#btnTxtOnOff").click(function(){if($.trim($(this).text()) === "Text Off"){$(this).text("Text On");$("#sid").css("visibility","hidden");}else{$(this).text("Text Off");$("#sid").css("visibility","visible");}});});</script></div>' +
527 529 '</div>',
528 530 //ajax: {
529 531 // url: 'app/views/ci/ci-view-detail.html'
... ... @@ -531,49 +533,47 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
531 533 title: $rootScope.getLocalStorageValue("currentViewTitle"),
532 534 position: {
533 535 top: 70,
534   - left: 20,
  536 + left: 20,
535 537 },
536 538  
537 539 size: { width: $(window).outerWidth() - 20, height: $(window).outerHeight() - 110 },
538 540  
539 541 });
540 542  
541   -
542 543 $('#canvasDiv img').load(function () {
543   -
  544 +
544 545 $rootScope.isLoading = false;
545 546 $('#spinner').css('visibility', 'hidden');
  547 + var canvas = document.getElementById("canvas");
  548 + var canvasPaint = document.getElementById("canvasPaint");
  549 + canvas.height = $(".img-thumbnail").height();
  550 + canvasPaint.height = $(".img-thumbnail").height();
546 551 });
547   -
548 552 $rootScope.currentSlug = 'adam-images-detail';
549   -
550 553 $rootScope.openViews.push(
551 554 {
552 555 "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentAIImageId,
553 556 "slug": $rootScope.currentSlug
554 557 });
555   -
556   -
557   - //$("#aiImagePanel .img-thumbnail").css("height", $("#aiImagePanel .jsPanel-content").height());
  558 +
  559 + $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height());
558 560 $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important')
559 561 var jspContentHeight = $('.jsPanel-content').height();
  562 +
  563 +
560 564  
  565 +
561 566 }
562   -
563   -
564 567 },
565 568 function (error) {
566 569 // handle errors here
567 570 console.log(' $scope.AIllustrationData = ' + error.statusText);
568 571 }
569   -
570 572 );
571   -
572 573 // console.log($rootScope.OpenAdamImages);
573 574 $('#AIView').css("height", $(window).outerHeight());
574 575  
575   - $('#AIView').css("width", $(window).outerWidth());
576   -
  576 + $('#AIView').css("width", $(window).outerWidth());
577 577 }
578 578  
579 579 $scope.$on('annotationToolEvent', function (event, data) {
... ... @@ -585,7 +585,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
585 585  
586 586 $("#canvas").css("display", "block");
587 587 $("#canvasPaint").css("display", "block");
588   -
  588 +
589 589 $rootScope.onDrawingCanvasClick();
590 590 $rootScope.FreeStylePaint();
591 591 });
... ... @@ -615,12 +615,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
615 615 var curAIListViewScroll = $rootScope.getLocalStorageValue("AIListViewScroll");
616 616 if (typeof (curAIListViewScroll) !== "undefined" && curAIListViewScroll !== null && curAIListViewScroll !== '') {
617 617 if (typeof InstallTrigger !== 'undefined') {
618   -
619   - $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") });
  618 + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") });
620 619 }
621 620 else {
622   -
623   - $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll"));
  621 + $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll"));
624 622 }
625 623  
626 624 }
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -1351,7 +1351,8 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
1351 1351 if (alreadyOpenThisView != null) {
1352 1352 for (var i = 0; i < $rootScope.openViews.length; i++) {
1353 1353 k++;
1354   - if ($rootScope.openViews[i].body - views == title) {
  1354 + //if ($rootScope.openViews[i].body - views == title) {
  1355 + if ($rootScope.openViews[i].body == title) {
1355 1356 $rootScope.openViews.splice((k - 1), 1);
1356 1357  
1357 1358 $rootScope.openViews.push(
... ... @@ -5596,18 +5597,23 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
5596 5597 ResizeImage(0);
5597 5598 }
5598 5599 });
5599   -
5600   - $(document).on('click', '#btnPrint', function () {
  5600 +
  5601 + $(document).one('click', '#btnPrint', function () {
  5602 +
5601 5603 PrintDivContentByID('printBoxPor');
  5604 + this.stopPropagation();
  5605 +
5602 5606 });
5603   -
  5607 +
5604 5608 function PrintDivContentByID(id) {
5605   -
5606 5609 if (id == 'printBoxPor') {
5607 5610 $("#printPSOptions").val("100%");
5608 5611 ResizeImage(1);
5609 5612 }
5610   - var contents = document.getElementById(id).innerHTML;
  5613 + var contents;
  5614 + $(document).ready(function () {
  5615 + contents = document.getElementById(id).innerHTML;
  5616 + });
5611 5617 // code for printng in ipads
5612 5618 var $ua = navigator.userAgent;
5613 5619 if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
... ... @@ -8,7 +8,7 @@
8 8 <form class="form-inline padd5">
9 9 <div class="form-group">
10 10 <label for="exampleInputName2" class="text-primary">Search</label>
11   - <input type="text" ng-change="hideListViewDiv()" ng-model="query.SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder="">
  11 + <input type="text" ng-model="query.SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder="">
12 12 </div>
13 13 <button type="button" class="btn btn-primary btn-sm" ng-click="ApplySearch(query)" style="margin-right:2px;">
14 14 <i class="fa fa-search"></i>
... ...