2 $(document).ready(function() {
6 if ($('#iframe') || $('#nagvis') || $('#hypermap')) {
7 var elements = $('#iframe, #nagvis, #hypermap');
9 var ua = navigator.userAgent.toLowerCase();
11 if (ua.indexOf('ipad') != -1 || ua.indexOf('android') != -1) {
13 var agent = (ua.indexOf('ipad') != -1) ? 'iPad' : 'Android';
15 elements.load(function () {
17 var note = $('<div style="position: relative; border: 1px solid #eebb55; padding: 8px; background: #fea; font-size: 9pt;"></div>');
19 if (elements.attr('id') === 'iframe') {
20 note.css('top', '28px');
23 note.append('<span>Known issues on ' + agent + ' with iframes </span>');
24 note.append($('<a href="#"></a>').html('Open in a new window').click(function () {
25 window.open('https://' + window.location.hostname + elements.attr('src'), '_blank');
28 var first = $(elements.contents().find('body')[0].firstChild);
37 function adjust_height_frame( selector ) {
39 var content_div = $( "body > .container > #content" ),
40 header_div = $( "body > .container >#header" ),
43 var height = body.height() - header_div.outerHeight();
44 var iframe = $( selector );
47 iframe.css( 'height', ( height - 4 ) + 'px' );
48 content_div.css( "height", (height) + "px" );
53 function adjust_height() {
55 adjust_height_frame('#iframe');
56 adjust_height_frame('#nagvis');
57 adjust_height_frame('#hypermap');
58 adjust_height_frame('#content');
60 $('body').css('overflow-y', 'hidden');
64 $(window).bind( "resize", adjust_height );