From 13904755b9b8c2f7b501b6d7bf4d3530ebb99020 Mon Sep 17 00:00:00 2001 From: Bruno Heridet Date: Wed, 20 Feb 2013 21:45:10 +0000 Subject: [PATCH] misc if simplification git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2446 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index eb716927..d8d58979 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1299,23 +1299,19 @@ if (!btn.list) { // Add given events to button $.each(btn.events, function(name, func) { - if (name == 'click') { - if (btn.type == 'mode') { - 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 { + if (name == 'click' && btn.type == 'mode') { + 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);