From 31398d591904b1cbe9523a9b5b1b47275568f836 2012-06-08 18:02:39 From: Brian Granger Date: 2012-06-08 18:02:39 Subject: [PATCH] Removing resizable SVGs from output. --- diff --git a/IPython/frontend/html/notebook/static/js/outputarea.js b/IPython/frontend/html/notebook/static/js/outputarea.js index 494f666..87af51c 100644 --- a/IPython/frontend/html/notebook/static/js/outputarea.js +++ b/IPython/frontend/html/notebook/static/js/outputarea.js @@ -275,37 +275,8 @@ var IPython = (function (IPython) { OutputArea.prototype.append_svg = function (svg, element) { var toinsert = $("
").addClass("box-flex1 output_subarea output_svg"); - // The tag cannot be made resizable so we wrap it in a resizable
. - // The problem with this is that we need to 1) set the initial size of the - //
based on the size of the and 2) we need to tie the size of the - //
and the . - var img = $('
'); - img.html(svg); - toinsert.append(img); - element.append(toinsert); - svg = img.find('svg'); - // The width and height returned here will be a string with units. Any units - // could be used and there is no way to reliably compute the equivalent pixels. - // Because of this the calls to width and height below simply pass on the unit - // information. - var w = svg.attr('width'); - var h = svg.attr('height'); - // Here we remove the attr versions of the width/height and set the css verions - // that we will be using later in the resize callback. - svg.removeAttr('height').removeAttr('width'); - img.width(w).height(h); - svg.width(w).height(h); - img.resizable({ - // We can't pass the minHeight/maxHeight options as they are required to - // be in pixels and we have no way to determining those numbers. - 'autoHide': true, - 'aspectRatio': true, - 'resize': function () { - $(this).find('svg').height($(this).height()); - $(this).find('svg').width($(this).width()); - } - }); - + toinsert.append(svg); + element.append(toinsert); };