From ac1f4753386f3ee29f27e82547a7590f4c39b367 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Mon, 14 Dec 2015 13:38:34 -0700 Subject: [PATCH 1/2] Data Attributes Check for compressor, min, and max data attributes on current active element --- jquery.fittext.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jquery.fittext.js b/jquery.fittext.js index 0b3ddef..1dff984 100644 --- a/jquery.fittext.js +++ b/jquery.fittext.js @@ -24,6 +24,11 @@ // Store the object var $this = $(this); + + // Check for compressor, min, and max data attributes on current active element + settings.compressor = $this.data('compression') !== undefined ? $this.data('compression') : settings.compressor; + settings.minFontSize = $this.data('min') !== undefined ? $this.data('min') : settings.minFontSize; + settings.maxFontSize = $this.data('max') !== undefined ? $this.data('max') : settings.maxFontSize; // Resizer() resizes items based on the object width divided by the compressor * 10 var resizer = function () { From d514ba04bb98388e30b6363529b9f4657a5470ae Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 17 Dec 2015 16:42:43 -0700 Subject: [PATCH 2/2] I got the compressor var mixed up. Fixed. --- jquery.fittext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.fittext.js b/jquery.fittext.js index 1dff984..eda6fa6 100644 --- a/jquery.fittext.js +++ b/jquery.fittext.js @@ -26,7 +26,7 @@ var $this = $(this); // Check for compressor, min, and max data attributes on current active element - settings.compressor = $this.data('compression') !== undefined ? $this.data('compression') : settings.compressor; + compressor = $this.data('compression') !== undefined ? $this.data('compression') : compressor; settings.minFontSize = $this.data('min') !== undefined ? $this.data('min') : settings.minFontSize; settings.maxFontSize = $this.data('max') !== undefined ? $this.data('max') : settings.maxFontSize;