From 4871d96f8478d9c368316187ddb5480dac9fb00e Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 13 Jan 2009 16:12:34 -0800 Subject: [PATCH] Fixing the padding within iframes within various browsers. --- static/css/ie7.css | 4 ++++ static/css/style.css | 10 +++++++--- static/js/Editor.js | 13 +++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/static/css/ie7.css b/static/css/ie7.css index 24c3580..3b4e820 100644 --- a/static/css/ie7.css +++ b/static/css/ie7.css @@ -22,3 +22,7 @@ width: auto; margin-left: auto; } + +.note_frame { + margin-bottom: 1em; +} diff --git a/static/css/style.css b/static/css/style.css index 800ea44..46596a1 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -526,10 +526,10 @@ h1 { .note_frame { -moz-border-radius: 5px; padding: 0em; + margin: 0em; overflow: hidden; width: 100%; border: 2px solid #999999; - margin: 0em; margin-bottom: 0.75em; background-color: #ffffff; overflow-x: auto; @@ -538,11 +538,12 @@ h1 { .static_note_div { -moz-border-radius: 5px; display: block; - padding: 1.5em 1.25em 1em 1.5em; + padding: 0em; + margin: 0em; font-family: sans-serif; overflow: hidden; + width: 100%; border: 2px solid #999999; - margin: 0em; margin-bottom: 1em; background-color: #ffffff; overflow-x: auto; @@ -553,6 +554,9 @@ h1 { } .static_note_contents { + display: block; + padding: 1.5em 1.5em 1em 1.5em; + margin: 0em; font-size: 90%; line-height: 140%; } diff --git a/static/js/Editor.js b/static/js/Editor.js index c56d26e..c07f4d3 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -1,6 +1,7 @@ GECKO = /Gecko/.test( navigator.userAgent ) && !/like Gecko/.test( navigator.userAgent ); WEBKIT = /WebKit/.test( navigator.userAgent ); -IE6 = /MSIE 6\.0/.test( navigator.userAgent ); +MSIE6 = /MSIE 6\.0/.test( navigator.userAgent ); +MSIE = /MSIE/.test( navigator.userAgent ); OPERA = /Opera/.test( navigator.userAgent ); @@ -220,8 +221,16 @@ Editor.prototype.set_iframe_contents = function ( contents_text ) { contents_text = "

​"; } + var padding = '1.5em'; + if ( GECKO ) + padding = '1.5em 1.5em 1em 1.5em'; + else if ( MSIE ) + padding = '1.5em 1.5em 2.25em 1.5em'; + else if ( WEBKIT ) + padding = '0.4em 1.5em 1em 1.5em'; + this.document.write( - '' + + '' + '' + contents_text + '' ); this.document.close();