forked from davatron5000/FitText.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
normalizado var para let, removido ponto e vírgula, aspas simples par…
…a duplas
- Loading branch information
1 parent
2ed9ba5
commit bb24fa0
Showing
1 changed file
with
13 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
$.fn.fitText = function( kompressor, options ) { | ||
|
||
// Setup options | ||
var compressor = kompressor || 1, | ||
let compressor = kompressor || 1, | ||
settings = $.extend({ | ||
'minFontSize' : Number.NEGATIVE_INFINITY, | ||
'maxFontSize' : Number.POSITIVE_INFINITY | ||
}, options); | ||
|
||
return this.each(function(){ | ||
minFontSize : -Infinity, | ||
maxFontSize : Infinity | ||
}, options) | ||
|
||
return this.each(function() { | ||
// Store the object | ||
var $this = $(this); | ||
let $this = $(this) | ||
|
||
// Resizer() resizes items based on the object width divided by the compressor * 10 | ||
var resizer = function () { | ||
$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize))); | ||
}; | ||
let resizer = function () { | ||
$this.css("font-size", Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize))) | ||
} | ||
|
||
// Call once to set. | ||
resizer(); | ||
resizer() | ||
|
||
// Call on resize. Opera debounces their resize by default. | ||
$(window).on('resize.fittext orientationchange.fittext', resizer); | ||
|
||
}); | ||
|
||
}; | ||
$(window).on("resize.fittext orientationchange.fittext", resizer) | ||
}) | ||
} |