From f85d4b9e885d7ab7dd932a9e73a8927ea57d6717 Mon Sep 17 00:00:00 2001 From: Jacob Brookover Date: Fri, 24 Jun 2011 16:28:34 +0000 Subject: [PATCH] -null element checks for alternative HTML interfaces git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2035 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 79a26bf4..854c238b 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -2137,7 +2137,9 @@ // Made public for UI customization. // TODO: Group UI functions into a public svgEditor.ui interface. Editor.addDropDown = function(elem, callback, dropUp) { + if ($(elem).length == 0) return; // Quit if called on non-existant element var button = $(elem).find('button'); + var list = $(elem).find('ul').attr('id', $(elem)[0].id + '-list'); if(!dropUp) { @@ -4227,8 +4229,11 @@ } $('#rulers').toggle(!!curConfig.showRulers); - $('#show_rulers')[0].checked = curConfig.showRulers; + if (curConfig.showRulers) { + $('#show_rulers')[0].checked = true; + } + if(curConfig.gridSnapping) { $('#grid_snapping_on')[0].checked = true; }