taoguan / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
0 stars 0 forks source link

Wrong width\height for hidden elements #105

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If jwysiwyg is applied to hidden textarea it either get 0\0 px resolution
or some values based on rows\cols values of textarea ignoring width and
height specified in css\style param. That's hapenning because actual size
of textarea isn't calculated by browser until it's shown.

Easy solution is to use folowing code ( lines 337 & 338 )

var newX = element.width || element.clientWidth ||
parseInt($(element).css('width'));
var newY = element.height || element.clientHeight ||
parseInt($(element).css('height'));

getting params from css can be moved before everything else, but this code
use it only as fallback.

Original issue reported on code.google.com by overk...@gmail.com on 27 Apr 2009 at 1:47