From a790c559c508887c48f6185162c468274ba6e26d Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Sun, 15 May 2016 22:52:11 -0300 Subject: [PATCH] carregamento do twitter apenas em dispositivos maiores que xs --- init/index.js | 36 ++++++++++++++++++++++++++---------- init/index.php | 63 +++++++++++++++++++++++++++++++++------------------------------ ogc/index.js | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------- ogc/index.php | 73 +++++++++++++++++++------------------------------------------------------ 4 files changed, 143 insertions(+), 113 deletions(-) diff --git a/init/index.js b/init/index.js index 974d235..e390905 100755 --- a/init/index.js +++ b/init/index.js @@ -199,27 +199,43 @@ function mostraBotoesBT(men){ var html = ""; //menu html = Mustache.to_html( - $("#menuTpl").html(), - i3GEO.idioma.objetoIdioma(g_traducao_init) + $("#menuTpl").html(), + i3GEO.idioma.objetoIdioma(g_traducao_init) ); $("#menuTpl").html(html); // $("#mensagemLogin").html(men); html = Mustache.to_html( - $("#jumbotron").html(), - { - "jumbotron" : $trad(35,g_traducao_init), - "host" : location.host, - "href" : location.href - } + $("#jumbotron").html(), + { + "jumbotron" : $trad(35,g_traducao_init), + "host" : location.host, + "href" : location.href + } ); $("#jumbotron").html(html); i3GEO.configura = {"locaplic" : ".."}; i3GEO.idioma.IDSELETOR = "bandeiras"; i3GEO.idioma.mostraSeletor(); html = Mustache.to_html( - "{{#d}}" + $("#botoesTpl").html() + "{{/d}}", - {"d":botoesIni,"abrir" : $trad(36,g_traducao_init)} + "{{#d}}" + $("#botoesTpl").html() + "{{/d}}", + {"d":botoesIni,"abrir" : $trad(36,g_traducao_init)} ); $("#botoesTpl").html(html); } +function findBootstrapDeviceSize() { + var dsize = ['lg', 'md', 'sm', 'xs']; + for (var i = dsize.length - 1; i >= 0; i--) { + + // Need to add   for Chrome. Works fine in Firefox/Safari/Opera without it. + // Chrome seem to have an issue with empty div's + $el = $('
 
'); + $el.appendTo($('body')); + + if ($el.is(':hidden')) { + $el.remove(); + return dsize[i]; + } + } + return 'unknown'; +} diff --git a/init/index.php b/init/index.php index 3c4cd94..e1db0bd 100755 --- a/init/index.php +++ b/init/index.php @@ -93,7 +93,7 @@ include "head.php";