-null element checks for alternative HTML interfaces

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2035 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jacob Brookover 2011-06-24 16:28:34 +00:00
parent 7220cd1079
commit f85d4b9e88
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}