Skip to content
Browse files

remove inline style of <body>, instead, use <style> tag to predefine …

…bgcolor
  • Loading branch information...
1 parent 64b3c6b commit 09991d6602b9b6924eef263da88ad4d83e771faa @DekusDenial committed Apr 9, 2012
Showing with 3 additions and 4 deletions.
  1. +2 −3 js/application.js
  2. +1 −1 stylesheets/screen.css
View
5 js/application.js
@@ -25,16 +25,15 @@
}
var $output = $('iframe#output'), inner = $output.contents();
- var body = inner.find('body').css('background', 'white');
- var styles = inner.find('head').append('<style>').children('style');
+ var body = inner.find('body');
+ var styles = inner.find('head').append('<style>').children('style').before('<style>body { background: white;}</style>');
// make jQuery and its alias available to the iframe
var $jslib = $('input:checked');
if ($jslib && $jslib.val() == 'jquery') {
$output[0].contentWindow.$ = $output[0].contentWindow.jQuery = window.top.$;
window.output_context = $output[0].contentWindow.output_context = $output[0].contentWindow.document;
}
-
$('textarea').on('keyup', function() {
var $area = $(this);
if ($area.attr('id') === 'html') {
View
2 stylesheets/screen.css
@@ -56,4 +56,4 @@ body, textarea, iframe { padding: 0 10px 10px; }
.input { float: left; width: 50%; padding-right: 10px; min-width: 310px; }
.output { float: left; width: 50%; min-width: 300px; height: 100%; }
-.output iframe { height: 90%; width: 100%; padding-bottom: 5px; border: none; }
+.output iframe { height: 90%; width: 100%; padding-bottom: 5px; border: none; }

0 comments on commit 09991d6

Please sign in to comment.
Something went wrong with that request. Please try again.