Fixed keyboard shortcuts on flyout buttons
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1315 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
b23c861650
commit
19449cd149
|
@ -143,7 +143,7 @@ $(function() {
|
||||||
type: "mode",
|
type: "mode",
|
||||||
icon: "images/cut.png",
|
icon: "images/cut.png",
|
||||||
title: "Connect two objects",
|
title: "Connect two objects",
|
||||||
key: "L",
|
key: "Shift+3",
|
||||||
includeWith: {
|
includeWith: {
|
||||||
button: '#tool_line',
|
button: '#tool_line',
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
|
|
|
@ -285,7 +285,8 @@ function svg_edit_setup() {
|
||||||
if(opts.isDefault) def = i;
|
if(opts.isDefault) def = i;
|
||||||
|
|
||||||
// Clicking the icon in flyout should set this set's icon
|
// Clicking the icon in flyout should set this set's icon
|
||||||
$(this).mouseup(function() {
|
|
||||||
|
var func = function() {
|
||||||
if (toolButtonClick(show_sel)) {
|
if (toolButtonClick(show_sel)) {
|
||||||
opts.fn();
|
opts.fn();
|
||||||
}
|
}
|
||||||
|
@ -302,7 +303,12 @@ function svg_edit_setup() {
|
||||||
shower.children(':not(.flyout_arrow_horiz)').remove();
|
shower.children(':not(.flyout_arrow_horiz)').remove();
|
||||||
shower.append(icon).attr('data-curopt', opts.sel); // This sets the current mode
|
shower.append(icon).attr('data-curopt', opts.sel); // This sets the current mode
|
||||||
shower.attr('title', $(opts.sel).attr('title'));
|
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,
|
sel: '#'+id,
|
||||||
fn: btn.events.click,
|
fn: btn.events.click,
|
||||||
icon: btn.id,
|
icon: btn.id,
|
||||||
|
key: btn.key,
|
||||||
isDefault: btn.includeWith?btn.includeWith.isDefault:0
|
isDefault: btn.includeWith?btn.includeWith.isDefault:0
|
||||||
}, ref_data];
|
}, ref_data];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue