Commit 2cf79d41dc3e8dea97ad5d6b96ad91dce3453a89

Authored by Nikita Kulshreshtha
1 parent 78a7cb13

now ip10 will be open in new tab

400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js
1 1 'use strict';
2 2  
3   -AIA.controller("LinkController", ["$scope", "$rootScope", "$log", "$location", "pages", "$routeParams",
4   -function ($scope, $rootScope, log, $location, pages, $routeParams) {
  3 +AIA.controller("LinkController", ["$scope", "$rootScope", "$log", "$location", "pages", "$routeParams", "$window",
  4 +function ($scope, $rootScope, log, $location, pages, $routeParams, $window) {
5 5  
6   - //$rootScope.currentActiveModuleTitle = Modules[10].Name;
  6 + //$rootScope.currentActiveModuleTitle = Modules[10].Name;
7 7 //$rootScope.currentActiveModuleTitle = $routeParams.modname;
8 8 $scope.links = [
9 9 new link("encyclopedia", "Encyclopedia", 'https://ssl.adam.com/content.aspx?site=aia5se3.adam.com&login=AIA41842&productId=117', "100%", "750px"),
... ... @@ -17,60 +17,58 @@ function ($scope, $rootScope, log, $location, pages, $routeParams) {
17 17 ];
18 18  
19 19 $scope.$on('$viewContentLoaded', function (event) {
20   -
  20 +
21 21  
22 22 if ($rootScope.refreshcheck == null) {
23 23 $location.path('/');
24 24 }
25 25 // code that will be executed ...
26 26 // every time this view is loaded
27   -
  27 +
28 28 var $uaAOD = navigator.userAgent;
29 29 for (var i = 0; i < $scope.links.length; i++) {
30 30 if ($scope.links[i].modname == $routeParams.modname) {
31 31 $rootScope.currentActiveModuleTitle = $scope.links[i].title;
32   - if ($rootScope.currentActiveModuleTitle == "IP 10" )
33   - {
34   - // document.getElementById('externalLink').style.height = "1024px";
35   - document.getElementById('externalLink').style.height = $(window).outerHeight() - 41 + "px";
  32 + if ($rootScope.currentActiveModuleTitle == "IP 10") {
  33 + // document.getElementById('externalLink').style.height = $(window).outerHeight() - 41 + "px";
  34 + $window.open($scope.links[i].objurl, '_blank');
  35 +
  36 +
  37 + }
  38 + else {
  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";
36 44  
  45 + }
37 46  
  47 + if ($rootScope.currentActiveModuleTitle == "A.D.A.M OnDemand") {
  48 + if ($uaAOD.match(/(iPod|iPhone|iPad)/i)) {
  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;
38 53  
  54 + }
  55 +
  56 + else {
  57 + document.getElementById('externalLink').style.height = $(window).outerHeight() - 128 + "px";
  58 +
  59 + }
  60 +
  61 + }
39 62 }
40   - $scope.objdata = $scope.links[i].objurl;
41   - $scope.myObj = $scope.links[i].objstyle;
42   - if ($('#externalLink').css('display') === 'none')
43   - {
44   - document.getElementById('externalLink').style.display = "block";
45   - document.getElementById('externalLinkiframe').style.display = "none";
46   -
47   - }
48   -
49   - if ($rootScope.currentActiveModuleTitle == "A.D.A.M OnDemand") {
50   - if ($uaAOD.match(/(iPod|iPhone|iPad)/i))
51   - {
52   - document.getElementById('externalLink').style.display = "none";
53   - document.getElementById('externalLinkiframe').style.display = "block";
54   - document.getElementById('externalLinkiframe').style.height = $(window).outerHeight() - 128 + "px";
55   - document.getElementById("externalLinkiframe").src = $scope.objdata;
56   -
57   - }
58   -
59   - else {
60   - document.getElementById('externalLink').style.height = $(window).outerHeight() - 128 + "px";
61   -
62   - }
63   -
64   - }
65   - }
  63 + }
66 64 }
67 65 });
68 66  
69 67 $scope.showTabButton = false;
70 68 $scope.IsVisible = function () {
71   - $scope.scroll();
  69 + $scope.scroll();
72 70  
73   - }
  71 + }
74 72  
75 73 $scope.scroll = function () {
76 74 // $window.scrollTo(0, 0);
... ...