From: Steve Sutton Date: Wed, 22 Oct 2014 17:17:12 +0000 (-0400) Subject: Update weather widget area to use jquery to load it X-Git-Tag: v1.0.0~54 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=2b6647fc95890d8772be65e784be4e841914c948;p=WP-Themes%2FVisitAlpena.git Update weather widget area to use jquery to load it --- diff --git a/js/app.js b/js/app.js index fea8051..43681b8 100644 --- a/js/app.js +++ b/js/app.js @@ -45,25 +45,25 @@ function get_footer_position() { } -;$(function(){ - if ($('.weather-widget').length && $('.weather-widget-popup').length) { - $('.weather-widget').appendTo($('.weather-widget-popup')); - $('.weather-widget-popup > a').on('click', function(){ - console.log('toggle me'); - if ($('.weather-widget').is(':visible')) { - console.log('hidden now showing'); - $('.weather-widget').css({'display': 'none'}); - } - else { - console.log('shown now hiding'); - $('.weather-widget').css({'display': 'block'}); - } - return false; - }); - $('.inner-wrap').click(function() { - if ($('.weather-widget').is(':visible')) { - $('.weather-widget').toggle(); - } - }); - } +;$(function () { + if ($('.weather-widget').length && $('.weather-widget-popup').length) { + $('.weather-widget').appendTo($('.weather-widget-popup')); + $('.weather-widget-popup > a').on('click', function () { + console.log('toggle me'); + if ($('.weather-widget').is(':visible')) { + $('.weather-widget-inner').html('

Loading ...

'); + $('.weather-widget').css({'display': 'none'}); + } + else { + $('.weather-widget-inner').html(''); + $('.weather-widget').css({'display': 'block'}); + } + return false; + }); + $('.inner-wrap').click(function () { + if ($('.weather-widget').is(':visible')) { + $('.weather-widget').toggle(); + } + }); + } }); \ No newline at end of file diff --git a/js/custom/weather-widget.js b/js/custom/weather-widget.js index 3d5ab00..466c74e 100644 --- a/js/custom/weather-widget.js +++ b/js/custom/weather-widget.js @@ -1,22 +1,22 @@ -$(function(){ - if ($('.weather-widget').length && $('.weather-widget-popup').length) { - $('.weather-widget').appendTo($('.weather-widget-popup')); - $('.weather-widget-popup > a').on('click', function(){ - console.log('toggle me'); - if ($('.weather-widget').is(':visible')) { - console.log('hidden now showing'); - $('.weather-widget').css({'display': 'none'}); - } - else { - console.log('shown now hiding'); - $('.weather-widget').css({'display': 'block'}); - } - return false; - }); - $('.inner-wrap').click(function() { - if ($('.weather-widget').is(':visible')) { - $('.weather-widget').toggle(); - } - }); - } +$(function () { + if ($('.weather-widget').length && $('.weather-widget-popup').length) { + $('.weather-widget').appendTo($('.weather-widget-popup')); + $('.weather-widget-popup > a').on('click', function () { + console.log('toggle me'); + if ($('.weather-widget').is(':visible')) { + $('.weather-widget-inner').html('

Loading ...

'); + $('.weather-widget').css({'display': 'none'}); + } + else { + $('.weather-widget-inner').html(''); + $('.weather-widget').css({'display': 'block'}); + } + return false; + }); + $('.inner-wrap').click(function () { + if ($('.weather-widget').is(':visible')) { + $('.weather-widget').toggle(); + } + }); + } }); \ No newline at end of file