Skip to content

Commit 34f4353

Browse files
Allow CSS inheritance globally
1 parent 0af12af commit 34f4353

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,26 @@ Because MODULARIZATION, this module doesn't come with debounce functionality inc
6969
module.config(['fitTextConfigProvider', function(fitTextConfigProvider) {
7070
fitTextConfigProvider.config = {
7171
debounce: _.debounce, // include a vender function like underscore or lodash
72-
debounce: function(a,b,c) { // specify your own function
72+
debounce: function(a,b,c) { // OR specify your own function
7373
var d;return function(){var e=this,f=arguments;clearTimeout(d),d=setTimeout(function(){d=null,c||a.apply(e,f)},b),c&&!d&&a.apply(e,f)}
7474
},
7575
delay: 1000, // debounce delay
7676
loadDelay: 10, // global default delay before initial calculation
7777
compressor: 1, // global default calculation multiplier
7878
min: 0, // global default min
79+
min: 'inherit', // OR inherit CSS values globally
7980
max: Number.POSITIVE_INFINITY // global default max
81+
max: 'inherit' // OR inherit CSS values globally
8082
};
8183
}]);
8284
```
8385

8486
### Changelog
8587

88+
#### [v4.2.0](https://github.com/patrickmarabeas/ng-FitText.js/releases/tag/v4.2.0)
89+
+ Globally `inherit` CSS values with `min` and `max` parameters in `fitTextConfigProvider`
90+
91+
8692
#### [v4.1.0](https://github.com/patrickmarabeas/ng-FitText.js/releases/tag/v4.1.0)
8793
+ Replace `'initial'` value with more semantic `'inherit'`
8894
+ Both `data-fittext-min` and `data-fittext-max` can use the inherited CSS value by using `'inherit'`

bower.json

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

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-fittext",
3-
"version": "4.1.1",
3+
"version": "4.2.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

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* ng-FitText.js v4.1.1
2+
* ng-FitText.js v4.2.0
33
* https://github.com/patrickmarabeas/ng-FitText.js
44
*
55
* Original jQuery project: https://github.com/davatron5000/FitText.js
@@ -8,7 +8,7 @@
88
* Released under the MIT license
99
* http://opensource.org/licenses/mit-license.php
1010
*
11-
* Date: 23/01/2016
11+
* Date: 27/04/2016
1212
*/
1313

1414
(function(window, document, angular, undefined) {
@@ -45,8 +45,10 @@
4545
, newlines = element.children().length || 1
4646
, loadDelay = attrs.fittextLoadDelay || config.loadDelay
4747
, compressor = attrs.fittext || config.compressor
48-
, minFontSize = (attrs.fittextMin ==='inherit' ? computed['font-size'] : attrs.fittextMin) || config.min
49-
, maxFontSize = (attrs.fittextMax === 'inherit' ? computed['font-size'] : attrs.fittextMax) || config.max
48+
, min = attrs.fittextMin || config.min
49+
, max = attrs.fittextMax || config.max
50+
, minFontSize = min ==='inherit'? computed['font-size'] : min
51+
, maxFontSize = max ==='inherit'? computed['font-size'] : max
5052
, lineHeight = computed['line-height']
5153
, display = computed['display']
5254
, calcSize = 10

0 commit comments

Comments
 (0)