1 function barre_forcer_hauteur () {
2 jQuery(".markItUpEditor", this == window
? null : this).each(function() {
3 var hauteur_min
= jQuery(this).height();
4 var hauteur_max
= parseInt(jQuery(window
).height()) - 200;
5 var hauteur
= hauteur_min
;
7 var signes
= jQuery(this).val().length
;
9 /* en gros: 400 signes donnent 100 pixels de haut */
10 var hauteur_signes
= Math
.round(signes
/ 4) + 50;
11 if (hauteur_signes
> hauteur_min
&& hauteur_signes
< hauteur_max
) {
12 hauteur
= hauteur_signes
;
14 if (hauteur_signes
> hauteur_max
) {
15 hauteur
= hauteur_max
;
19 jQuery(this).height(hauteur
);
24 jQuery(window
).on("load", function() {
25 barre_forcer_hauteur();
26 onAjaxLoad(barre_forcer_hauteur
);