From 19449cd149a120ac4f05add9a862ad8ac4bf684f Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Mon, 1 Feb 2010 14:41:34 +0000 Subject: [PATCH] Fixed keyboard shortcuts on flyout buttons git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1315 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/ext-connector.js | 2 +- editor/svg-editor.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/editor/ext-connector.js b/editor/ext-connector.js index 2a4b92db..820aa9f9 100644 --- a/editor/ext-connector.js +++ b/editor/ext-connector.js @@ -143,7 +143,7 @@ $(function() { type: "mode", icon: "images/cut.png", title: "Connect two objects", - key: "L", + key: "Shift+3", includeWith: { button: '#tool_line', isDefault: false, diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 1003cbad..92bb8c5b 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -285,7 +285,8 @@ function svg_edit_setup() { if(opts.isDefault) def = i; // Clicking the icon in flyout should set this set's icon - $(this).mouseup(function() { + + var func = function() { if (toolButtonClick(show_sel)) { opts.fn(); } @@ -302,7 +303,12 @@ function svg_edit_setup() { shower.children(':not(.flyout_arrow_horiz)').remove(); shower.append(icon).attr('data-curopt', opts.sel); // This sets the current mode shower.attr('title', $(opts.sel).attr('title')); - }); + } + + $(this).mouseup(func); + if(opts.key) { + $(document).bind('keydown', {combi: opts.key+''}, func); + } }); @@ -441,6 +447,7 @@ function svg_edit_setup() { sel: '#'+id, fn: btn.events.click, icon: btn.id, + key: btn.key, isDefault: btn.includeWith?btn.includeWith.isDefault:0 }, ref_data];