git-svn-id: http://core.svn.wordpress.org/trunk@20804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5181e0abd3
commit
bf0154a731
|
@ -1,11 +1,13 @@
|
||||||
/*
|
/*
|
||||||
Distraction Free Writing mode TinyMCE Styles
|
Distraction Free Writing mode TinyMCE Styles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
html, body {
|
html,
|
||||||
|
body {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
margin: 0;
|
margin: 0 !important;
|
||||||
padding: 0;
|
padding: 0 !important;
|
||||||
|
min-height: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
tinymce.create('tinymce.plugins.wpFullscreenPlugin', {
|
tinymce.create('tinymce.plugins.wpFullscreenPlugin', {
|
||||||
|
|
||||||
init : function(ed, url) {
|
init : function(ed, url) {
|
||||||
var t = this, oldHeight = 0, s = {}, DOM = tinymce.DOM, resized = false;
|
var t = this, oldHeight = 0, s = {}, DOM = tinymce.DOM;
|
||||||
|
|
||||||
// Register commands
|
// Register commands
|
||||||
ed.addCommand('wpFullScreenClose', function() {
|
ed.addCommand('wpFullScreenClose', function() {
|
||||||
|
@ -112,26 +112,22 @@
|
||||||
* This method gets executed each time the editor needs to resize.
|
* This method gets executed each time the editor needs to resize.
|
||||||
*/
|
*/
|
||||||
function resize() {
|
function resize() {
|
||||||
if ( resized )
|
|
||||||
return;
|
|
||||||
|
|
||||||
var d = ed.getDoc(), DOM = tinymce.DOM, resizeHeight, myHeight;
|
var d = ed.getDoc(), DOM = tinymce.DOM, resizeHeight, myHeight;
|
||||||
|
|
||||||
// Get height differently depending on the browser used
|
// Get height differently depending on the browser used
|
||||||
if ( tinymce.isIE || tinymce.isWebKit )
|
if ( tinymce.isWebKit )
|
||||||
myHeight = d.body.scrollHeight;
|
|
||||||
else
|
|
||||||
myHeight = d.body.offsetHeight;
|
myHeight = d.body.offsetHeight;
|
||||||
|
else
|
||||||
|
myHeight = d.body.scrollHeight;
|
||||||
|
|
||||||
// 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 ) {
|
||||||
resized = true;
|
|
||||||
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;
|
oldHeight = resizeHeight;
|
||||||
|
ed.getWin().scrollTo(0,0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue