Commit 035511d2fbbb64ccb215498eebbae1288e27388a

Authored by Mukul Rajput
1 parent 4bfd9579

this is scroll issue in IPAD

400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js
@@ -29,21 +29,32 @@ function ($scope, $rootScope, log, $location, pages, $routeParams) { @@ -29,21 +29,32 @@ function ($scope, $rootScope, log, $location, pages, $routeParams) {
29 for (var i = 0; i < $scope.links.length; i++) { 29 for (var i = 0; i < $scope.links.length; i++) {
30 if ($scope.links[i].modname == $routeParams.modname) { 30 if ($scope.links[i].modname == $routeParams.modname) {
31 $rootScope.currentActiveModuleTitle = $scope.links[i].title; 31 $rootScope.currentActiveModuleTitle = $scope.links[i].title;
32 - if ($rootScope.currentActiveModuleTitle == "IP 10" || $rootScope.currentActiveModuleTitle == "A.D.A.M OnDemand") 32 + if ($rootScope.currentActiveModuleTitle == "IP 10")
33 { 33 {
34 - // document.getElementById('externalLink').style.height = "1024px";  
35 - if ($uaAOD.match(/(iPod|iPhone|iPad|android)/i)) {  
36 - document.getElementById('externalLink').style.height = 2048 + "px"; 34 +
  35 + // document.getElementById('externalLink').style.height = "1024px";
  36 + document.getElementById('externalLink').style.height = $(window).outerHeight() - 41 + "px";
  37 + }
  38 +
  39 + $scope.objdata = $scope.links[i].objurl;
  40 + $scope.myObj = $scope.links[i].objstyle;
  41 + if ($('#externalLink').css('display') === 'none') {
  42 + document.getElementById('externalLink').style.display = "block";
  43 + document.getElementById('externalLinkiframe').style.display = "none";
  44 + }
  45 + if ($rootScope.currentActiveModuleTitle == "A.D.A.M OnDemand") {
  46 +
  47 + if ($uaAOD.match(/(iPod|iPhone|iPad)/i)) {
  48 +
  49 + document.getElementById('externalLink').style.display = "none";
  50 + document.getElementById('externalLinkiframe').style.display = "block";
  51 + document.getElementById('externalLinkiframe').style.height = $(window).outerHeight() - 128 + "px";
  52 + document.getElementById("externalLinkiframe").src = $scope.objdata;
37 } 53 }
38 else { 54 else {
39 document.getElementById('externalLink').style.height = $(window).outerHeight() - 128 + "px"; 55 document.getElementById('externalLink').style.height = $(window).outerHeight() - 128 + "px";
40 } 56 }
41 -  
42 -  
43 -  
44 } 57 }
45 - $scope.objdata = $scope.links[i].objurl;  
46 - $scope.myObj = $scope.links[i].objstyle;  
47 } 58 }
48 } 59 }
49 }); 60 });
400-SOURCECODE/AIAHTML5.Web/app/views/Link/Link-view.html
1 -<div class="bodyWrap row ">  
2 - <div ng-include="'app/widget/MainMenu.html'" />  
3 - <div class="main" >  
4 - <div id="siteloader" class="col-sm-12">  
5 - <!--<object style="width:100%; height:100%" type="text/html" data={{objdata}}></object>-->  
6 - <object id="externalLink" ng-style="myObj" type="text/html" data={{objdata}}></object>  
7 - </div>  
8 - </div>  
9 -</div>  
10 -  
11 -<script>  
12 - $(document).ready(function () {  
13 - var myEventMethod = null;  
14 - var myEventListener = null;  
15 - var myEventMessage = null;  
16 - myEventMethod = window.addEventListener ? "addEventListener" : "attachEvent";  
17 - // create event listener  
18 - myEventListener = window[myEventMethod];  
19 - // browser compatibility: attach event uses onmessage  
20 - myEventMessage = myEventMethod == "attachEvent" ? "onmessage" : "message";  
21 - // register callback function on incoming message  
22 - myEventListener(myEventMessage, function (e) {  
23 - // we will get a string (better browser support) and validate  
24 - // if it is an int - set the height of the iframe #my-iframe-id  
25 - if (e.data == parseInt(e.data)) {  
26 - document.getElementById('externalLink').height = e.data + "px";  
27 - $('body').scrollTop(0);  
28 - }  
29 - }, false);  
30 - });  
31 -  
32 -</script>  
33 -  
34 - 1 +<div class="bodyWrap row ">
  2 + <div ng-include="'app/widget/MainMenu.html'" />
  3 + <div class="main" >
  4 + <div id="siteloader" class="col-sm-12">
  5 + <!--<object style="width:100%; height:100%" type="text/html" data={{objdata}}></object>-->
  6 + <object id="externalLink" ng-style="myObj" type="text/html" data={{objdata}}></object>
  7 + <iframe style="width:100%;display:none" id="externalLinkiframe" ng-style="myObj" src=""></iframe>
  8 + </div>
  9 + </div>
  10 +</div>
  11 +
  12 +<script>
  13 + $(document).ready(function () {
  14 + var myEventMethod = null;
  15 + var myEventListener = null;
  16 + var myEventMessage = null;
  17 + myEventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
  18 + // create event listener
  19 + myEventListener = window[myEventMethod];
  20 + // browser compatibility: attach event uses onmessage
  21 + myEventMessage = myEventMethod == "attachEvent" ? "onmessage" : "message";
  22 + // register callback function on incoming message
  23 + myEventListener(myEventMessage, function (e) {
  24 + // we will get a string (better browser support) and validate
  25 + // if it is an int - set the height of the iframe #my-iframe-id
  26 + if (e.data == parseInt(e.data)) {
  27 + document.getElementById('externalLink').height = e.data + "px";
  28 + $('body').scrollTop(0);
  29 + }
  30 + }, false);
  31 + });
  32 +
  33 +</script>
  34 +
  35 +