From 363eef5d5731d4057889a484bc2f701d21f98e63 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Wed, 27 Jan 2010 21:03:43 +0000 Subject: [PATCH] Added keyboard shortcut option for extension buttons, made import of connectors work, fixed issue 442 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1286 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/ext-connector.js | 11 +++++++++-- editor/svg-editor.html | 2 +- editor/svg-editor.js | 22 ++++++++++++++++++++++ editor/svgcanvas.js | 14 +++++++++++++- 4 files changed, 45 insertions(+), 4 deletions(-) diff --git a/editor/ext-connector.js b/editor/ext-connector.js index 2c95ea74..4b70bf37 100644 --- a/editor/ext-connector.js +++ b/editor/ext-connector.js @@ -1,6 +1,5 @@ $(function() { svgCanvas.addExtension("Connector", function(vars) { - var svgcontent = vars.content, svgroot = vars.root, getNextId = vars.getNextId, @@ -144,6 +143,7 @@ $(function() { type: "mode", icon: "images/cut.png", title: "Connect two objects", + key: "L", events: { 'click': function() { svgCanvas.setMode("connector"); @@ -198,7 +198,6 @@ $(function() { var i = elems.length; var connectors = $(svgcontent).find("." + conn_class); if(!connectors.length) return; - connections = []; while(i--) { @@ -349,6 +348,14 @@ $(function() { showPanel(false); } } + }, + elementChanged: function(opts) { + var elem = opts.elems[0]; + if (elem && elem.tagName == 'svg' && elem.id == "svgcontent") { + // Update svgcontent (can change on import) + svgcontent = elem; + } + } }; }); diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 1e3c82f9..22aa05bc 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -18,7 +18,7 @@ - +