'use strict'; AIA.controller("LinkController", ["$scope", "$rootScope", "$log", "$location", "pages", "$routeParams", function ($scope, $rootScope, log, $location, pages, $routeParams) { //$rootScope.currentActiveModuleTitle = Modules[10].Name; //$rootScope.currentActiveModuleTitle = $routeParams.modname; $scope.links = [ new link("encyclopedia", "Encyclopedia", 'https://ssl.adam.com/content.aspx?site=aia5se3.adam.com&login=AIA41842&productId=117', "100%", "750px"), new link("IP-10", "IP 10", "http://interactiveanatomy.com/IPWeb10/index.aspx", "100%", "750px"), new link("indepth-reports", "InDepth Reports", "https://ssl.adam.com/content.aspx?site=aia5se3.adam.com&login=AIA41842&productId=10", "100%", "4000px"), new link("complementary-and-alternate-medicine", "Complementary and Alternative Medicine", "https://ssl.adam.com/content.aspx?site=aia5se3.adam.com&login=AIA41842&productId=107", "100%", "750px"), new link("bodyguide", "Body Guide", "https://ssl.adam.com/content.aspx?site=aia5se3.adam.com&login=AIA41842&productId=25 ", "100%", "1050px"), new link("health-navigator", "Health Navigator", "https://ssl.adam.com/content.aspx?site=aia5se3.adam.com&login=AIA41842&productId=65 ", "100%", "1000px"), new link("wellness-tools", "The Wellness Tools", "https://ssl.adam.com/content.aspx?site=aia5se3.adam.com&login=AIA41842&productId=20 ", "100%", "1500px"), new link("aod", "A.D.A.M OnDemand", "http://uat.adamondemand.com/Home/AIACatalog?categoriesID=2", "100%", "1500px") ]; $scope.$on('$viewContentLoaded', function (event) { if ($rootScope.refreshcheck == null) { $location.path('/'); } // code that will be executed ... // every time this view is loaded var $uaAOD = navigator.userAgent; for (var i = 0; i < $scope.links.length; i++) { if ($scope.links[i].modname == $routeParams.modname) { $rootScope.currentActiveModuleTitle = $scope.links[i].title; if ($rootScope.currentActiveModuleTitle == "IP 10" ) { // document.getElementById('externalLink').style.height = "1024px"; document.getElementById('externalLink').style.height = $(window).outerHeight() - 41 + "px"; } $scope.objdata = $scope.links[i].objurl; $scope.myObj = $scope.links[i].objstyle; if ($('#externalLink').css('display') === 'none') { document.getElementById('externalLink').style.display = "block"; document.getElementById('externalLinkiframe').style.display = "none"; } if ($rootScope.currentActiveModuleTitle == "A.D.A.M OnDemand") { if ($uaAOD.match(/(iPod|iPhone|iPad)/i)) { document.getElementById('externalLink').style.display = "none"; document.getElementById('externalLinkiframe').style.display = "block"; document.getElementById('externalLinkiframe').style.height = $(window).outerHeight() - 128 + "px"; document.getElementById("externalLinkiframe").src = $scope.objdata; } else { document.getElementById('externalLink').style.height = $(window).outerHeight() - 128 + "px"; } } } } }); $scope.showTabButton = false; $scope.IsVisible = function () { $scope.scroll(); } $scope.scroll = function () { // $window.scrollTo(0, 0); $("html,body").scrollTop(0); //alert("scroll"); } }] );