misc if simplification

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2446 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Bruno Heridet 2013-02-20 21:45:10 +00:00
parent 5cad5c9981
commit 13904755b9
1 changed files with 12 additions and 16 deletions

View File

@ -1299,23 +1299,19 @@
if (!btn.list) { if (!btn.list) {
// Add given events to button // Add given events to button
$.each(btn.events, function(name, func) { $.each(btn.events, function(name, func) {
if (name == 'click') { if (name == 'click' && btn.type == 'mode') {
if (btn.type == 'mode') { if (btn.includeWith) {
if (btn.includeWith) {
button.bind(name, func);
} else {
button.bind(name, function() {
if (toolButtonClick(button)) {
func();
}
});
}
if (btn.key) {
$(document).bind('keydown', btn.key, func);
if (btn.title) button.attr('title', btn.title + ' ['+btn.key+']');
}
} else {
button.bind(name, func); button.bind(name, func);
} else {
button.bind(name, function() {
if (toolButtonClick(button)) {
func();
}
});
}
if (btn.key) {
$(document).bind('keydown', btn.key, func);
if (btn.title) button.attr('title', btn.title + ' ['+btn.key+']');
} }
} else { } else {
button.bind(name, func); button.bind(name, func);