reducing the max character count for blocks at specific view width. max is down to...
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 12 Aug 2016 20:56:20 +0000 (16:56 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 12 Aug 2016 20:56:20 +0000 (16:56 -0400)
js/app.js
js/custom/pageSetup.js

index cde400b..a778dfd 100644 (file)
--- 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");
         }
index fe8769f..2ec0dfe 100644 (file)
@@ -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");
         }