Commit ccea592a49d84bc557da9f453790cbc36bc877be

Authored by Birendra Kumar
1 parent fb3ac9fe

few link disabled while open resource

400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... ... @@ -1489,6 +1489,22 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1489 1489 $('body,html').animate({ scrollTop: $('#' + selected_Id).position().top }, 500);
1490 1490 }
1491 1491 }
  1492 +
  1493 +
  1494 + //open resoruce on slide
  1495 + $scope.loadResourceOnCurrentSlide = function (id) {
  1496 +
  1497 + }
  1498 +
1492 1499 }]
1493 1500 );
1494 1501  
  1502 +function GetAIAModuleInformation(id) {
  1503 + alert(id);
  1504 +
  1505 + var scope = angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope();
  1506 + scope.$apply(function () {
  1507 + scope.loadResourceOnCurrentSlide(id);
  1508 + });
  1509 +}
  1510 +
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -493,16 +493,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
493 493 $rootScope.isLoading = true;
494 494 $('#spinner').css('visibility', 'visible');
495 495  
496   - var u = $location.url();
  496 + // var u = $location.url();
  497 + var isopenResourceRequest = sessionStorage.getItem('isModuleOpenByOpenResource');
497 498  
498   - if ($rootScope.isOpenResourceBtnClicked == true) {
  499 + if (isopenResourceRequest == "true") {
499 500 // $rootScope.MULTI_VIEW_ID = $rootScope.MULTI_VIEW_ID + 1;
500   - $rootScope.multiViewInfoIndex = 0;
501   - $rootScope.multiViewInfo.push({ "Target": $event.currentTarget, "id": $rootScope.MULTI_VIEW_ID, "bodyViewID": $event.currentTarget.id, "bodyName": $event.currentTarget.textContent });
502   - // $rootScope.multiSearchData = [];
503   - localStorage.setItem("multiViewInfo", JSON.stringify($rootScope.multiViewInfo));
504   - console.log($rootScope.multiViewInfo);
505   - $location.url('/curriculum-builder-detail');
  501 + //$rootScope.multiViewInfoIndex = 0;
  502 + //$rootScope.multiViewInfo.push({ "Target": $event.currentTarget, "id": $rootScope.MULTI_VIEW_ID, "bodyViewID": $event.currentTarget.id, "bodyName": $event.currentTarget.textContent });
  503 + //// $rootScope.multiSearchData = [];
  504 + //localStorage.setItem("multiViewInfo", JSON.stringify($rootScope.multiViewInfo));
  505 + //console.log($rootScope.multiViewInfo);
  506 + //$location.url('/curriculum-builder-detail');
  507 + // $(document, parent.window.document).trigger('myCustomTrigger');
  508 +
  509 + parent.GetDaViewId($event.currentTarget.id);
  510 +
  511 + parent.closeIFrame();
  512 +
506 513  
507 514 }
508 515 else {
... ... @@ -515,7 +522,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
515 522 $('#spinner').css('visibility', 'hidden');
516 523  
517 524 }
518   -
  525 +
519 526 //load json data for body view
520 527 $scope.loadDissectibleAnatomyData = function () {
521 528  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -127,6 +127,10 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
127 127 // break;
128 128 //}
129 129  
  130 + $rootScope.isModuleOpenByOpenResource = true;
  131 +
  132 + sessionStorage.setItem('isModuleOpenByOpenResource', 'true');
  133 +
130 134 $('#dvOpenResoucePanel').css('display', 'block');
131 135  
132 136 // var homepath = $location.protocol() + "//" + $location.host() + ":" + $location.port() + "/";
... ... @@ -142,7 +146,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
142 146 currentController: 'HomeController',
143 147 parentSlug: 'curriculum-builder-detail',
144 148 content: '<div class="col-sm-12" >' +
145   - '<object data="' + homepath + '" width="100%" height="600px" type="text/html" id="OpenModuleInCB" onload="loadOpenResource(event)"></object>',
  149 + '<object data="' + homepath + '" width="100%" height="600px" type="text/html" id="OpenModuleInCB" onload="loadOpenResource(this)"></object>',
146 150 title: "Open Module in Curriculum Builder",
147 151 position: {
148 152 top: 1,
... ... @@ -155,34 +159,33 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
155 159 width: screen.width-10,
156 160 height: 600
157 161 },
158   -
  162 +
159 163 });
160   -
  164 +
161 165 }
162 166  
163   - $scope.loadOpenResource = function () {
  167 + $scope.loadOpenResource = function (iframe) {
164 168  
165   - var iframe = document.getElementById('OpenModuleInCB');
  169 + //var iframe = document.getElementById('OpenModuleInCB');
166 170 var innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document;
167 171 var head = $(innerDoc).contents().find("head");
168 172 if (head != undefined && head != null)
169 173 {
170   - $scope.loadopenresourceContent(head);
  174 + $scope.loadopenresourceContent(head, iframe);
171 175 }
172 176 else
173 177 {
174 178 $timeout(function () {
175 179  
176 180 var head = $(innerDoc).contents().find("head");
177   - $scope.loadopenresourceContent(head);
  181 + $scope.loadopenresourceContent(head, iframe);
178 182  
179 183 }, 1000);
180 184 }
181   -
182   -
  185 +
183 186 }
184 187  
185   - $scope.loadopenresourceContent=function(header)
  188 + $scope.loadopenresourceContent = function (header, iframe)
186 189 {
187 190 //disable link
188 191 var css = '<style type="text/css">' +
... ... @@ -205,6 +208,24 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
205 208 '</style>';
206 209  
207 210 $(header).append(css);
  211 + $timeout(function () {
  212 + // var elmnt = iframe.contentWindow.document.getElementById("da-view-list");
  213 + // var location1 = iframe.contentWindow.document.location.href;
  214 +
  215 + // $('#' + elmnt.id).trigger('click');
  216 + // $("#" + elmnt.id).css({ "display": "none", "pointer-events": "none", "opacity": ".5" });
  217 + // iframe.setAttribute("src", location + "/da-view-list");
  218 + //window.location.href = location;
  219 + // var currentlocation = iframe.contentWindow.document.location.href;
  220 + // iframe.contentWindow.document.locatiom.replace(currentlocation + "da-view-list");
  221 + // document.getElementById("OpenModuleInCB").src = "http://stackoverflow.com";
  222 + // location.replace("https://www.w3schools.com")
  223 +
  224 + // window.top.location.href = "http://www.example.com";
  225 + var myframe = iframe;
  226 +
  227 + }, 1000);
  228 +
208 229  
209 230 }
210 231  
... ... @@ -6828,15 +6849,23 @@ function printImagePreview(event) {
6828 6849  
6829 6850 }
6830 6851  
6831   -function loadOpenResource(event) {
  6852 +function loadOpenResource(iframe) {
6832 6853  
6833 6854 console.log('resource loading')
6834 6855 var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope();
6835 6856  
6836 6857 scope.$apply(function () {
6837   - scope.loadOpenResource();
  6858 + scope.loadOpenResource(iframe);
6838 6859  
6839 6860 });
6840 6861  
6841 6862 }
6842 6863  
  6864 +function closeIFrame() {
  6865 + $('#OpenResourcePanel').remove();
  6866 + $("#CBDetailPageDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" });
  6867 + $(".navbar-fixed-top").css({ "display": "block", "pointer-events": "auto", "opacity": "1" });
  6868 + $("#topMenuBar").css({ "display": "block", "pointer-events": "auto", "opacity": "1" });
  6869 +}
  6870 +
  6871 +
... ...