Skip to content

Commit

Permalink
Fix to container width issue and script end global
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Oct 12, 2011
1 parent c3db839 commit 3ddde55
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/deck.coder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ This module adds a code editor that shows up in individual slides
}

function addScript(str) {
return str.replace(/SCRIPTEND/,'</s' + 'cript>').replace(/SCRIPT/g,'<script>')
return str.replace(/SCRIPTEND/g,'</s' + 'cript>').replace(/SCRIPT/g,'<script>')
}

function runCode(element,template) {
iframe = document.createElement("IFRAME");
iframe.style.width = ($(element).parent().width()-2) + "px";
iframe.style.height = ($(element).parent().height()-2) + "px";
iframe.style.overflow = 'auto';
iframe.style.border ="none";

var dest = $(element).attr('data-target');
var destination = $("#" + dest );
iframe.style.width = (destination.parent().width()-2) + "px";
iframe.style.height = (destination.parent().height()-2) + "px";
iframe.style.overflow = 'auto';
iframe.style.border ="none";

$(destination).html("").append(iframe);


Expand Down

0 comments on commit 3ddde55

Please sign in to comment.