From 35092be25da2ed290f80978c56d2c454c0e503ec Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Mon, 13 Jul 2009 19:47:48 +0000 Subject: [PATCH] Fade flyouts slowly the first time they are opened git-svn-id: http://svg-edit.googlecode.com/svn/trunk@324 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index dba35939..bf6b0ebf 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -16,7 +16,8 @@ function svg_edit_setup() { svgCanvas.setMode('select'); } - // used to make the flyouts stay ont he screen longer the very first time + // used to make the flyouts stay on the screen longer the very first time + var flyoutspeed = 1250; var textBeingEntered = false; var selectedElement = null; var multiselected = false; @@ -274,9 +275,10 @@ function svg_edit_setup() { // - removes the tool_button_current class from whatever tool currently has it // - hides any flyouts // - adds the tool_button_current class to the button passed in - var toolButtonClick = function(button) { + var toolButtonClick = function(button, fadeFlyouts) { if ($(button).hasClass('tool_button_disabled')) return false; - $('.tools_flyout').fadeOut(); + var fadeFlyouts = fadeFlyouts || 'normal'; + $('.tools_flyout').fadeOut(fadeFlyouts); $('#styleoverrides').text(''); $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); $(button).addClass('tool_button_current'); @@ -305,7 +307,8 @@ function svg_edit_setup() { }; var clickSquare = function(){ - if (toolButtonClick('#tools_rect_show')) { + if (toolButtonClick('#tools_rect_show', flyoutspeed)) { + flyoutspeed = 'normal'; svgCanvas.setMode('square'); } $('#tools_rect_show').attr('src', 'images/square.png'); @@ -326,7 +329,8 @@ function svg_edit_setup() { }; var clickCircle = function(){ - if (toolButtonClick('#tools_ellipse_show')) { + if (toolButtonClick('#tools_ellipse_show', flyoutspeed)) { + flyoutspeed = 'normal'; svgCanvas.setMode('circle'); } $('#tools_ellipse_show').attr('src', 'images/circle.png');