DFW: fix auto-resize in WebKit, fixes #20608
git-svn-id: https://develop.svn.wordpress.org/trunk@20723 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
eeb4df859b
commit
0ad0b4d829
|
@ -115,24 +115,23 @@
|
||||||
if ( resized )
|
if ( resized )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var d = ed.getDoc(), DOM = tinymce.DOM, resizeHeight, myHeight;
|
var d = ed.getDoc(), body = d.body, DOM = tinymce.DOM, resizeHeight, myHeight;
|
||||||
|
|
||||||
// Get height differently depending on the browser used
|
// Get height differently depending on the browser used
|
||||||
if ( tinymce.isIE )
|
if ( tinymce.isIE || tinymce.isWebKit )
|
||||||
myHeight = d.body.scrollHeight;
|
myHeight = d.body.scrollHeight;
|
||||||
else
|
else
|
||||||
myHeight = d.documentElement.offsetHeight;
|
myHeight = body.offsetHeight;
|
||||||
|
|
||||||
// Don't make it smaller than 300px
|
// Don't make it smaller than 300px
|
||||||
resizeHeight = (myHeight > 300) ? myHeight : 300;
|
resizeHeight = (myHeight > 300) ? myHeight : 300;
|
||||||
|
|
||||||
// Resize content element
|
// Resize content element
|
||||||
if ( oldHeight != resizeHeight ) {
|
if ( oldHeight != resizeHeight ) {
|
||||||
oldHeight = resizeHeight;
|
|
||||||
resized = true;
|
resized = true;
|
||||||
setTimeout(function(){ resized = false; }, 100);
|
setTimeout(function(){ resized = false; }, 100);
|
||||||
|
|
||||||
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
||||||
|
oldHeight = resizeHeight;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue