Commit 9c054623d03bc645801e65dae1ccd05a94cdb87e
1 parent
43de9ffa
topen resource partially committed
Showing
1 changed file
with
47 additions
and
3 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -133,8 +133,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
133 | 133 | var homepath = $rootScope.homeURL; |
134 | 134 | $("#CBDetailPageDiv").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); |
135 | 135 | $(".navbar-fixed-top").css({"display": "none", "pointer-events": "none", "opacity": ".5" }); |
136 | - $("#topMenuBar").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); | |
137 | - | |
136 | + | |
138 | 137 | |
139 | 138 | $.jsPanel({ |
140 | 139 | id: 'OpenResourcePanel', |
... | ... | @@ -143,7 +142,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
143 | 142 | currentController: 'HomeController', |
144 | 143 | parentSlug: 'curriculum-builder-detail', |
145 | 144 | content: '<div class="col-sm-12" >' + |
146 | - '<object data="' + homepath + '" width="100%" height="600px" type="text/html" id="openmodulecb"></object>', | |
145 | + '<object data="' + homepath + '" width="100%" height="600px" type="text/html" id="OpenModuleInCB" onload="loadOpenResource(event)"></object>', | |
147 | 146 | title: "Open Module in Curriculum Builder", |
148 | 147 | position: { |
149 | 148 | top: 1, |
... | ... | @@ -161,6 +160,40 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
161 | 160 | |
162 | 161 | } |
163 | 162 | |
163 | + $scope.loadOpenResource = function () { | |
164 | + | |
165 | + var iframe = document.getElementById('OpenModuleInCB'); | |
166 | + var innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document; | |
167 | + var head = $(innerDoc).contents().find("head"); | |
168 | + if (head != undefined && head != null) | |
169 | + { | |
170 | + $scope.loadopenresourceContent(head); | |
171 | + } | |
172 | + else | |
173 | + { | |
174 | + $timeout(function () { | |
175 | + | |
176 | + var head = $(innerDoc).contents().find("head"); | |
177 | + $scope.loadopenresourceContent(head); | |
178 | + | |
179 | + }, 1000); | |
180 | + } | |
181 | + | |
182 | + | |
183 | + } | |
184 | + | |
185 | + $scope.loadopenresourceContent=function(header) | |
186 | + { | |
187 | + var css = '<style type="text/css">' + | |
188 | + '#topMenuBar{pointer-events: none; opacity: .3} ' + | |
189 | + '#Anatomy Test{pointer-events: none; opacity: .3} ' + | |
190 | + '#Encyclopedia{pointer-events: none; opacity: .3} ' + | |
191 | + | |
192 | + '</style>'; | |
193 | + | |
194 | + $(header).append(css); | |
195 | + } | |
196 | + | |
164 | 197 | $rootScope.forgotPwdModalShow = function () { |
165 | 198 | document.getElementById("forgetPwdForm").reset() |
166 | 199 | $("#forgotPwdModal").modal("show"); |
... | ... | @@ -6781,4 +6814,15 @@ function printImagePreview(event) { |
6781 | 6814 | |
6782 | 6815 | } |
6783 | 6816 | |
6817 | +function loadOpenResource(event) { | |
6818 | + | |
6819 | + console.log('resource loading') | |
6820 | + var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope(); | |
6821 | + | |
6822 | + scope.$apply(function () { | |
6823 | + scope.loadOpenResource(); | |
6824 | + | |
6825 | + }); | |
6826 | + | |
6827 | +} | |
6784 | 6828 | ... | ... |