From 5ce77bca33ad2ab3eeafa7297f6379aa4b474bc4 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Mon, 13 Jul 2009 03:02:29 +0000 Subject: [PATCH] Prevent U keystroke from landing in the source editor git-svn-id: http://svg-edit.googlecode.com/svn/trunk@314 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 29cc5d0a..7b689539 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -422,6 +422,7 @@ function svg_edit_setup() { $('#svg_source_textarea').val(str); $('#svg_source_editor').fadeIn(); properlySourceSizeTextArea(); + $('#svg_source_textarea').focus(); }; var properlySourceSizeTextArea = function(){ @@ -438,12 +439,12 @@ function svg_edit_setup() { } $('#svg_source_editor').hide(); editingsource = false; + $('#svg_source_textarea').blur(); }; // TODO: add canvas-centering code in here $(window).resize(function(evt) { if (!editingsource) return; - properlySourceSizeTextArea(); }); @@ -524,7 +525,7 @@ function svg_edit_setup() { $(document).bind('keydown', {combi:'z', disableInInput: true}, clickUndo); $(document).bind('keydown', {combi:'shift+z', disableInInput: true}, clickRedo); $(document).bind('keydown', {combi:'y', disableInInput: true}, clickRedo); - $(document).bind('keydown', {combi:'u', disableInInput: true}, showSourceEditor); + $(document).bind('keydown', {combi:'u', disableInInput: true}, function(evt){showSourceEditor();evt.preventDefault();}); $(document).bind('keydown', {combi:'esc', disableInInput: false}, hideSourceEditor); // temporary binding to test setSvgString() /*