Commit f95e31ca8537ccf89baf65e595167ea1dd32f5e9
1 parent
1d18f046
fix issue of module duplicate by open resource
Showing
1 changed file
with
77 additions
and
43 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -198,6 +198,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
198 | 198 | var homepath = $rootScope.homeURL; |
199 | 199 | $("#HomeContainerDiv").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); |
200 | 200 | $(".navbar-fixed-top").css({"display": "none", "pointer-events": "none", "opacity": ".5" }); |
201 | + // if any panel in minimized mode | |
202 | + $("#jsPanel-min-container").css({"display":"none"}); | |
203 | + | |
201 | 204 | |
202 | 205 | var parentslag = ""; |
203 | 206 | var openNewlink = ""; |
... | ... | @@ -319,7 +322,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
319 | 322 | //$('#' + elmnt.id).trigger('click'); |
320 | 323 | sessionStorage.setItem('isModuleOpenByOpenResource', 'true'); |
321 | 324 | sessionStorage.removeItem('ExitsCBFileDetail'); |
322 | - | |
325 | + | |
323 | 326 | OpenDefaultModule(iframe); |
324 | 327 | |
325 | 328 | }, 500); |
... | ... | @@ -341,11 +344,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
341 | 344 | |
342 | 345 | $rootScope.isCallFromOtherModule = true; |
343 | 346 | |
344 | - if ($location.url() == "/curriculum-builder-detail") { | |
345 | - window.parent.AIAModuleOpenResoureInCB(newWindowData); | |
346 | - } | |
347 | - else | |
348 | - { | |
347 | + if ($location.url() != "/curriculum-builder-detail") { | |
349 | 348 | var newwindowNo = 0; |
350 | 349 | |
351 | 350 | var ExistData = ModuleService.getModuleData(newWindowData.mType); |
... | ... | @@ -359,23 +358,51 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
359 | 358 | } |
360 | 359 | |
361 | 360 | ModuleService.setModuleData(newWindowData, newwindowNo); |
362 | - $scope.loadOpenResourceWindow(newWindowData.mType); | |
361 | + } | |
362 | + | |
363 | + if ($location.url() == "/curriculum-builder-detail") { | |
364 | + | |
365 | + window.parent.AIAModuleOpenResoureInCB(newWindowData); | |
366 | + } | |
367 | + else if (($location.url() == "/da-body-view")) { | |
368 | + | |
369 | + $scope.loadOpenResourceWindow(newWindowData.mType, '#daBodyview'); | |
370 | + } | |
371 | + else if ($location.url() == "/clinical-illustrations-detail") { | |
372 | + $scope.loadOpenResourceWindow(newWindowData.mType, '#CIView'); | |
373 | + } | |
374 | + else if ($location.url() == "/module-item-view") { | |
375 | + | |
376 | + $scope.loadOpenResourceWindow(newWindowData.mType, '#aaBodyView'); | |
377 | + } | |
378 | + else if ($location.url() == "/clinical-animations-detail") { | |
379 | + $scope.loadOpenResourceWindow(newWindowData.mType, '#CAView'); | |
380 | + } | |
381 | + else if ($location.url() == "/adam-images-detail") { | |
382 | + $scope.loadOpenResourceWindow(newWindowData.mType, '#AIView'); | |
383 | + } | |
384 | + else if ($location.url() == "/3d-anatomy-details") { | |
385 | + | |
386 | + $scope.loadOpenResourceWindow(newWindowData.mType, '#ThreeDView'); | |
387 | + } | |
388 | + else if ($location.url() == "/lab-exercise-view") { | |
389 | + | |
390 | + $scope.loadOpenResourceWindow(newWindowData.mType, '#labBodyview'); | |
363 | 391 | } |
364 | 392 | |
365 | 393 | }, 500); |
366 | 394 | |
367 | 395 | |
368 | 396 | } |
369 | - | |
370 | - $scope.loadOpenResourceWindow = function (moduleName) | |
397 | + $scope.loadOpenResourceWindow = function (moduleName,BasemoduleDivId) | |
371 | 398 | { |
372 | 399 | switch (moduleName) { |
373 | 400 | case "DISSECTIBLE_ANATOMY": |
374 | - var daSectionExist = document.getElementById('daOpenModuleDiv'); | |
401 | + var daSectionExist = document.getElementById('daCustomModuleDiv'); | |
375 | 402 | |
376 | - if (daSectionExist == null) { | |
377 | - $("#HomeContainerDiv").append($('<div id="daOpenModuleDiv"></div>')); | |
378 | - var html = $('#daOpenModuleDiv').append("<da-directive></da-directive>"); | |
403 | + if (daSectionExist == null && BasemoduleDivId != "#daBodyview") { | |
404 | + $(BasemoduleDivId).append($('<div id="daCustomModuleDiv"></div>')); | |
405 | + var html = $('#daCustomModuleDiv').append("<da-directive></da-directive>"); | |
379 | 406 | $compile(html)($scope); |
380 | 407 | } |
381 | 408 | else { |
... | ... | @@ -384,11 +411,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
384 | 411 | } |
385 | 412 | break; |
386 | 413 | case "ATLAS_ANATOMY": |
387 | - var aaSectionExist = document.getElementById('aaOpenModuleDiv'); | |
414 | + var aaSectionExist = document.getElementById('aaCustomModuleDiv'); | |
388 | 415 | |
389 | - if (aaSectionExist == null) { | |
390 | - $("#HomeContainerDiv").append($('<div id="aaOpenModuleDiv"></div>')); | |
391 | - var html = $('#aaOpenModuleDiv').append("<atlas-anatomy-directive></atlas-anatomy-directive>"); | |
416 | + if (aaSectionExist == null && BasemoduleDivId != "#aaBodyView") { | |
417 | + $(BasemoduleDivId).append($('<div id="aaCustomModuleDiv"></div>')); | |
418 | + var html = $('#aaCustomModuleDiv').append("<atlas-anatomy-directive></atlas-anatomy-directive>"); | |
392 | 419 | $compile(html)($scope); |
393 | 420 | } |
394 | 421 | else { |
... | ... | @@ -397,11 +424,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
397 | 424 | } |
398 | 425 | break; |
399 | 426 | case "CLINICAL_ILLUSTRATIONS": |
400 | - var ciSectionExist = document.getElementById('ciOpenModuleDiv'); | |
427 | + var ciSectionExist = document.getElementById('ciCustomModuleDiv'); | |
401 | 428 | |
402 | - if (ciSectionExist == null) { | |
403 | - $("#HomeContainerDiv").append($('<div id="ciOpenModuleDiv"></div>')); | |
404 | - var html = $('#ciOpenModuleDiv').append("<clinical-illustration-directive></clinical-illustration-directive>"); | |
429 | + if (ciSectionExist == null && BasemoduleDivId != "#CIView") { | |
430 | + $(BasemoduleDivId).append($('<div id="ciCustomModuleDiv"></div>')); | |
431 | + var html = $('#ciCustomModuleDiv').append("<clinical-illustration-directive></clinical-illustration-directive>"); | |
405 | 432 | $compile(html)($scope); |
406 | 433 | } |
407 | 434 | else { |
... | ... | @@ -410,11 +437,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
410 | 437 | } |
411 | 438 | break; |
412 | 439 | case "ADAM_IMAGES": |
413 | - var aiSectionExist = document.getElementById('aiOpenModuleDiv'); | |
440 | + var aiSectionExist = document.getElementById('aiCustomModuleDiv'); | |
414 | 441 | |
415 | - if (aiSectionExist == null) { | |
416 | - $("#HomeContainerDiv").append($('<div id="aiOpenModuleDiv"></div>')); | |
417 | - var html = $('#aiOpenModuleDiv').append("<adam-image-directive></adam-image-directive>"); | |
442 | + if (aiSectionExist == null && BasemoduleDivId != "#AIView") { | |
443 | + $(BasemoduleDivId).append($('<div id="aiCustomModuleDiv"></div>')); | |
444 | + var html = $('#aiCustomModuleDiv').append("<adam-image-directive></adam-image-directive>"); | |
418 | 445 | $compile(html)($scope); |
419 | 446 | } |
420 | 447 | else { |
... | ... | @@ -423,11 +450,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
423 | 450 | } |
424 | 451 | break; |
425 | 452 | case "CLINICAL_ANIMATIONS": |
426 | - var caSectionExist = document.getElementById('caOpenModuleDiv'); | |
453 | + var caSectionExist = document.getElementById('caCustomModuleDiv'); | |
427 | 454 | |
428 | - if (caSectionExist == null) { | |
429 | - $("#HomeContainerDiv").append($('<div id="caOpenModuleDiv"></div>')); | |
430 | - var html = $('#caOpenModuleDiv').append("<clinical-animation-directive></clinical-animation-directive>"); | |
455 | + if (caSectionExist == null && BasemoduleDivId != "#CAView") { | |
456 | + $(BasemoduleDivId).append($('<div id="caCustomModuleDiv"></div>')); | |
457 | + var html = $('#caCustomModuleDiv').append("<clinical-animation-directive></clinical-animation-directive>"); | |
431 | 458 | $compile(html)($scope); |
432 | 459 | } |
433 | 460 | else { |
... | ... | @@ -436,11 +463,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
436 | 463 | } |
437 | 464 | break; |
438 | 465 | case "THREE_D_ANATOMY": |
439 | - var threeDSectionExist = document.getElementById('theeDOpenModuleDiv'); | |
466 | + var threeDSectionExist = document.getElementById('theeDCustomModuleDiv'); | |
440 | 467 | |
441 | - if (threeDSectionExist == null) { | |
442 | - $("#HomeContainerDiv").append($('<div id="theeDOpenModuleDiv"></div>')); | |
443 | - var html = $('#theeDOpenModuleDiv').append("<threed-anatomy-directive></threed-anatomy-directive>"); | |
468 | + if (threeDSectionExist == null && BasemoduleDivId != "#ThreeDView") { | |
469 | + $(BasemoduleDivId).append($('<div id="theeDCustomModuleDiv"></div>')); | |
470 | + var html = $('#theeDCustomModuleDiv').append("<threed-anatomy-directive></threed-anatomy-directive>"); | |
444 | 471 | $compile(html)($scope); |
445 | 472 | } |
446 | 473 | else { |
... | ... | @@ -450,11 +477,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
450 | 477 | |
451 | 478 | break; |
452 | 479 | case "LAB_EXERCISE": |
453 | - var labSectionExist = document.getElementById('labOpenModuleDiv'); | |
480 | + var labSectionExist = document.getElementById('labCustomModuleDiv'); | |
454 | 481 | |
455 | - if (labSectionExist == null) { | |
456 | - $("#HomeContainerDiv").append($('<div id="labOpenModuleDiv"></div>')); | |
457 | - var html = $('#labOpenModuleDiv').append("<lab-exercise-directive></lab-exercise-directive>"); | |
482 | + if (labSectionExist == null && BasemoduleDivId != "#labBodyview") { | |
483 | + $(BasemoduleDivId).append($('<div id="labCustomModuleDiv"></div>')); | |
484 | + var html = $('#labCustomModuleDiv').append("<lab-exercise-directive></lab-exercise-directive>"); | |
458 | 485 | $compile(html)($scope); |
459 | 486 | } |
460 | 487 | else { |
... | ... | @@ -464,11 +491,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
464 | 491 | |
465 | 492 | break; |
466 | 493 | case "MY_PICTURES": |
467 | - var picSectionExist = document.getElementById('picOpenModuleDiv'); | |
494 | + var picSectionExist = document.getElementById('picCustomModuleDiv'); | |
468 | 495 | |
469 | - if (picSectionExist == null) { | |
470 | - $("#HomeContainerDiv").append($('<div id="picOpenModuleDiv"></div>')); | |
471 | - var html = $('#picOpenModuleDiv').append("<my-picture-directive></my-picture-directive>"); | |
496 | + if (picSectionExist == null ||picSectionExist==undefined) { | |
497 | + $(BasemoduleDivId).append($('<div id="picCustomModuleDiv"></div>')); | |
498 | + var html = $('#picCustomModuleDiv').append("<my-picture-directive></my-picture-directive>"); | |
472 | 499 | $compile(html)($scope); |
473 | 500 | } |
474 | 501 | else { |
... | ... | @@ -2109,7 +2136,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
2109 | 2136 | if (index == 0) { |
2110 | 2137 | var panel1 = document.getElementById(moduleImagePanel[index].id); |
2111 | 2138 | |
2112 | - $("#" + panel1.id).css("top", firsttopPosition + 'px'); | |
2139 | + if (!$(panel1).hasClass("jsPanel-state-minimized")) { | |
2140 | + $("#" + panel1.id).css("top", firsttopPosition + 'px'); | |
2141 | + } | |
2113 | 2142 | |
2114 | 2143 | } |
2115 | 2144 | else { |
... | ... | @@ -2117,7 +2146,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
2117 | 2146 | var lastTop = prevpanel.offsetTop + prevpanel.offsetHeight + 10; |
2118 | 2147 | var lastpanel = document.getElementById(moduleImagePanel[index].id); |
2119 | 2148 | |
2120 | - $("#" + lastpanel.id).css("top", lastTop + 'px'); | |
2149 | + if (!$(lastpanel).hasClass("jsPanel-state-minimized")) { | |
2150 | + $("#" + lastpanel.id).css("top", lastTop + 'px'); | |
2151 | + } | |
2152 | + | |
2121 | 2153 | } |
2122 | 2154 | |
2123 | 2155 | //Reset menu option like list manager,annotation when close module |
... | ... | @@ -7114,6 +7146,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
7114 | 7146 | |
7115 | 7147 | $('#dvOpenResourcePanel').remove(); |
7116 | 7148 | sessionStorage.removeItem('isModuleOpenByOpenResource'); |
7149 | + $("#jsPanel-min-container").removeAttr("style"); | |
7117 | 7150 | }); |
7118 | 7151 | |
7119 | 7152 | $rootScope.restrictBodySystemList = function () { |
... | ... | @@ -7389,6 +7422,7 @@ function closeIFrame() { |
7389 | 7422 | function AIAModuleOpenResourceInfo(windowData) { |
7390 | 7423 | sessionStorage.removeItem('isModuleOpenByOpenResource'); |
7391 | 7424 | window.parent.closeIFrame(); |
7425 | + $("#jsPanel-min-container").removeAttr("style"); | |
7392 | 7426 | var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope(); |
7393 | 7427 | scope.$apply(function () { |
7394 | 7428 | scope.AIAModuleOpenResourceInfo(windowData); | ... | ... |