From 9293eb66e6e402833f5f1b0dc98738d54eb7915d Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Sun, 28 Jun 2009 05:09:10 +0000 Subject: [PATCH] Change flyouts to close when mousing out. Also since rect/ellipse flyouts can no longer get stuck open, remove code to hide them and change color picker to not be a flyout git-svn-id: http://svg-edit.googlecode.com/svn/trunk@216 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.css | 6 +++--- editor/svg-editor.html | 2 +- editor/svg-editor.js | 19 ++++++++++--------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/editor/svg-editor.css b/editor/svg-editor.css index c3fd4a87..09132c2b 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -200,12 +200,12 @@ div.color_block { padding: 2px; } -#svg_editor #color_pick { +#svg_editor #color_picker { position: absolute; display: none; background: #E8E8E8; - border: 1px solid #808080; - padding: 5px; +/* border: 1px solid #808080; + padding: 5px;*/ } #svg_editor .tools_flyout { diff --git a/editor/svg-editor.html b/editor/svg-editor.html index c7e469ab..d06f4e89 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -228,7 +228,7 @@ -
+
diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 8de33cca..663c5869 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -227,14 +227,12 @@ function svg_edit_setup() { // This is a common function used when a tool has been clicked (chosen) // It does several common things: - // - hides any flyout menus // - removes the tool_button_current class from whatever tool currently has it // - adds the tool_button_current class to the button passed in var toolButtonClick = function(button) { if ($(button).hasClass('tool_button_disabled')) return false; $('#styleoverrides').text(''); - $('.tools_flyout').hide("slow"); $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); $(button).addClass('tool_button_current'); // when a tool is selected, we should deselect the currently selected element @@ -420,7 +418,6 @@ function svg_edit_setup() { $(document).bind('keydown', {combi:'y', disableInInput: true}, clickRedo); var colorPicker = function(elem) { - $('.tools_flyout').hide(); var oldbg = elem.css('background'); var color = elem.css('background-color'); var was_none = false; @@ -512,15 +509,19 @@ function svg_edit_setup() { updateToolButtonState(); }); - // this hides any flyouts and then shows the rect flyout - $('#tools_rect_show').mouseover(function(){ - $('.tools_flyout').hide(); + $('#tools_rect_show').mouseenter(function(){ $('#tools_rect').show(); }); - // this hides any flyouts and then shows the circle flyout - $('#tools_ellipse_show').mouseover(function(){ - $('.tools_flyout').hide(); + $('#tools_rect').mouseleave(function() { + $('#tools_rect').hide(); + }); + + $('#tools_ellipse').mouseleave(function() { + $('#tools_ellipse').hide(); + }); + + $('#tools_ellipse_show').mouseenter(function(){ $('#tools_ellipse').show(); });