From: Joris van Zundert Date: Fri, 3 Feb 2012 23:38:05 +0000 (+0100) Subject: Small fix (null check on stemmagraph load). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=33bd75ece8ff375aa5f58999454fede4d860b76c;p=scpubgit%2Fstemmatology.git Small fix (null check on stemmagraph load). --- diff --git a/stemmaweb/root/js/componentload.js b/stemmaweb/root/js/componentload.js index 8db28dd..e8003a3 100644 --- a/stemmaweb/root/js/componentload.js +++ b/stemmaweb/root/js/componentload.js @@ -13,9 +13,10 @@ function loadTradition( textid ) { // TODO: scale #stemma_grpah both horizontally and vertically // TODO: load svgs from SVG.Jquery (to make scaling react in Safari) $('#stemma_graph').load( basepath + "/stemma/" + textid , function() { - var stemma_svg_element = $('#stemma_graph svg').svg().svg('get').root(); - console.log( stemma_svg_element ); - stemma_svg_element.height.baseVal.value = $('#stemma_graph').height(); + if( $('#stemma_graph svg').size() != 0 ) { + var stemma_svg_element = $('#stemma_graph svg').svg().svg('get').root(); + stemma_svg_element.height.baseVal.value = $('#stemma_graph').height(); + } }); $('#variant_graph').load( basepath + "/variantgraph/" + textid , function() { var variant_svg_element = $('#variant_graph svg').svg().svg('get').root();