Skip to content

Commit

Permalink
Ability to set min to inherited CSS font-size value
Browse files Browse the repository at this point in the history
Breaking change: 'initial' replaced with 'inherit'
  • Loading branch information
patrickmarabeas committed Jan 23, 2016
1 parent d96958e commit c21f1a1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngFitText",
"version": "4.0.0",
"version": "4.1.0",
"main": [
"dist/ng-FitText.min.js"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/ng-FitText.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ <h3 data-fittext>ng-FitText.js can do that too, at the same price</h3>
</div>
</div>

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

<p>Child block elements will use font size of longest element</p>
<h1 data-fittext>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-fittext",
"version": "4.0.0",
"version": "4.1.0",
"description": "An AngularJS directive for inflating web type",
"homepage": "https://github.com/patrickmarabeas/ng-FitText.js",
"bugs": "https://github.com/patrickmarabeas/ng-FitText.js/issues",
Expand Down
9 changes: 5 additions & 4 deletions src/ng-FitText.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* ng-FitText.js v4.0.0
/**
* ng-FitText.js v4.1.0
* https://github.com/patrickmarabeas/ng-FitText.js
*
* Original jQuery project: https://github.com/davatron5000/FitText.js
Expand All @@ -7,7 +8,7 @@
* Released under the MIT license
* http://opensource.org/licenses/mit-license.php
*
* Date: 18/01/2016
* Date: 23/01/2016
*/

(function(window, document, angular, undefined) {
Expand Down Expand Up @@ -42,8 +43,8 @@
, newlines = element.children().length || 1
, loadDelay = attrs.fittextLoadDelay || config.loadDelay
, compressor = attrs.fittext || config.compressor
, minFontSize = attrs.fittextMin || config.min
, maxFontSize = (attrs.fittextMax === 'initial' ? computed['font-size'] : attrs.fittextMax) || config.max
, minFontSize = (attrs.fittextMin ==='inherit' ? computed['font-size'] : attrs.fittextMin) || config.min
, maxFontSize = (attrs.fittextMax === 'inherit' ? computed['font-size'] : attrs.fittextMax) || config.max
, lineHeight = computed['line-height']
, display = computed['display']
, calcSize = 10
Expand Down

0 comments on commit c21f1a1

Please sign in to comment.