Skip to content

Commit c21f1a1

Browse files
Ability to set min to inherited CSS font-size value
Breaking change: 'initial' replaced with 'inherit'
1 parent d96958e commit c21f1a1

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngFitText",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"main": [
55
"dist/ng-FitText.min.js"
66
],

dist/ng-FitText.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ <h3 data-fittext>ng-FitText.js can do that too, at the same price</h3>
4848
</div>
4949
</div>
5050

51-
<h1 class="setInitial" data-fittext data-fittext-max="initial">Max font size is CSS font-size</h1>
51+
<h1 class="setInitial" data-fittext data-fittext-max="inherit">Inherit max font size from CSS</h1>
52+
<h1 class="setInitial" data-fittext data-fittext-min="inherit">Inherit min font size from CSS</h1>
5253

5354
<p>Child block elements will use font size of longest element</p>
5455
<h1 data-fittext>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-fittext",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"description": "An AngularJS directive for inflating web type",
55
"homepage": "https://github.com/patrickmarabeas/ng-FitText.js",
66
"bugs": "https://github.com/patrickmarabeas/ng-FitText.js/issues",

src/ng-FitText.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* ng-FitText.js v4.0.0
1+
/**
2+
* ng-FitText.js v4.1.0
23
* https://github.com/patrickmarabeas/ng-FitText.js
34
*
45
* Original jQuery project: https://github.com/davatron5000/FitText.js
@@ -7,7 +8,7 @@
78
* Released under the MIT license
89
* http://opensource.org/licenses/mit-license.php
910
*
10-
* Date: 18/01/2016
11+
* Date: 23/01/2016
1112
*/
1213

1314
(function(window, document, angular, undefined) {
@@ -42,8 +43,8 @@
4243
, newlines = element.children().length || 1
4344
, loadDelay = attrs.fittextLoadDelay || config.loadDelay
4445
, compressor = attrs.fittext || config.compressor
45-
, minFontSize = attrs.fittextMin || config.min
46-
, maxFontSize = (attrs.fittextMax === 'initial' ? computed['font-size'] : attrs.fittextMax) || config.max
46+
, minFontSize = (attrs.fittextMin ==='inherit' ? computed['font-size'] : attrs.fittextMin) || config.min
47+
, maxFontSize = (attrs.fittextMax === 'inherit' ? computed['font-size'] : attrs.fittextMax) || config.max
4748
, lineHeight = computed['line-height']
4849
, display = computed['display']
4950
, calcSize = 10

0 commit comments

Comments
 (0)