From b0f006ce5319fda4282cd43d2aaebda51f6f0601 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 12 Aug 2016 16:56:20 -0400 Subject: [PATCH] reducing the max character count for blocks at specific view width. max is down to 11 at 640 to 667 --- js/app.js | 18 +++++++++++++++++- js/custom/pageSetup.js | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index cde400b..a778dfd 100644 --- a/js/app.js +++ b/js/app.js @@ -136,9 +136,25 @@ $(document).ready(function () { }); + var view_btn = $(".view-all"); + var block = $('.glm-block'); + var btn_text_length, btn_text; + // initialize the slick sliders on the events and blocks front page function check_window_width(){ - var block = $('.glm-block'); + + if($(window).width() < 667 && $(window).width() > 639){ + $(view_btn).each( function (){ + btn_text = $(this).text(); + btn_text_length = $(this).text().length; + console.log(btn_text_length); + + if(btn_text_length > 12){ + $(this).text(btn_text.substr(0,12)); + } + }); + } + if( $(window).width() == 640 ){ $(block).css("margin", "0 -15px"); } diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index fe8769f..2ec0dfe 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -127,9 +127,25 @@ $(document).ready(function () { }); + var view_btn = $(".view-all"); + var block = $('.glm-block'); + var btn_text_length, btn_text; + // initialize the slick sliders on the events and blocks front page function check_window_width(){ - var block = $('.glm-block'); + + if($(window).width() < 667 && $(window).width() > 639){ + $(view_btn).each( function (){ + btn_text = $(this).text(); + btn_text_length = $(this).text().length; + console.log(btn_text_length); + + if(btn_text_length > 12){ + $(this).text(btn_text.substr(0,12)); + } + }); + } + if( $(window).width() == 640 ){ $(block).css("margin", "0 -15px"); } -- 2.17.1