From 0bedf3e5d28ef75a992da6d30b79d93220b8b1fb Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 17 Feb 2015 10:58:18 +0100 Subject: advanced css calc() failback --- view/theme/redbasic/js/redbasic.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'view/theme/redbasic/js/redbasic.js') diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 53ee45648..3db67dc87 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -1,9 +1,18 @@ $(document).ready(function() { -if($(window).width() < 767) { - $('main').css('width', $(window).width() + 231 ); +// CSS3 calc() fallback (for unsupported browsers) +$('body').append(''); +if( $('#css3-calc').width() == 10) { + $(window).resize(function() { + if($(window).width() < 767) { + $('main').css('width', $(window).width() + 231 ); + } else { + $('main').css('width', '100%' ); + } + }); } +$('#css3-calc').remove(); // Remove the test element $('#expand-aside').click(function() { $('#expand-aside-icon').toggleClass('icon-circle-arrow-right').toggleClass('icon-circle-arrow-left'); -- cgit v1.2.3