From 06d53a325b30cb9a1264ddda2f271b73d2e114f6 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 29 Jan 2010 21:28:46 +0000 Subject: [PATCH] Made various fixes/changes, made new icon for connector tool git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1308 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/ext-connector.js | 2 +- editor/images/conn.svg | 27 ++++++++++++++++++---- editor/svg-editor.css | 6 +++-- editor/svg-editor.js | 51 ++++++++++++++--------------------------- 4 files changed, 45 insertions(+), 41 deletions(-) diff --git a/editor/ext-connector.js b/editor/ext-connector.js index 0ad0c6eb..2a4b92db 100644 --- a/editor/ext-connector.js +++ b/editor/ext-connector.js @@ -146,7 +146,7 @@ $(function() { key: "L", includeWith: { button: '#tool_line', - isDefault: true, + isDefault: false, position: 1 }, events: { diff --git a/editor/images/conn.svg b/editor/images/conn.svg index 8d0f3af7..1af5e9a4 100644 --- a/editor/images/conn.svg +++ b/editor/images/conn.svg @@ -1,9 +1,28 @@ - - - - + + + + + + + + + + + + + + Layer 1 + + + + + + + + + diff --git a/editor/svg-editor.css b/editor/svg-editor.css index 5911c314..71aa2c21 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -441,8 +441,8 @@ #svg_editor .flyout_arrow_horiz { position: absolute; - bottom: 3%; - right: 5%; + bottom: -1px; + right: 0; z-index: 10; } @@ -690,6 +690,7 @@ span.zoom_tool { bottom: 0px; background-color: black; opacity: 0.6; + z-index: 5; } #svg_source_editor #svg_source_container { @@ -702,6 +703,7 @@ span.zoom_tool { opacity: 1.0; text-align: center; border: 1px outset #777; + z-index: 6; } /* diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 28da4c3b..2f5c5b31 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -301,6 +301,7 @@ function svg_edit_setup() { icon[0].setAttribute('height',shower.height()); shower.children(':not(.flyout_arrow_horiz)').remove(); shower.append(icon).attr('data-curopt', opts.sel); // This sets the current mode + shower.attr('title', $(opts.sel).attr('title')); }); }); @@ -319,12 +320,14 @@ function svg_edit_setup() { var holder = $(show_sel.replace('_show','')); var l = holder.css('left'); var w = holder.width()*-1; + var time = holder.data('shown_popop')?200:0; timer = setTimeout(function() { // Show corresponding menu holder.css('left', w).show().animate({ left: l },150); - },200); + holder.data('shown_popop',true); + },time); evt.preventDefault(); }).mouseup(function() { clearTimeout(timer); @@ -1001,6 +1004,8 @@ function svg_edit_setup() { } } on_button = false; + }).mousedown(function() { + $('.tools_flyout:visible').fadeOut(); }); overlay.bind('mousedown',function() { @@ -1539,7 +1544,7 @@ function svg_edit_setup() { }); $.resizeSvgIcons({ - '.flyout_arrow_horiz svg, .flyout_arrow_horiz img': size_num / 3, + '.flyout_arrow_horiz svg, .flyout_arrow_horiz img': size_num / 5, '#logo > svg, #logo > img': size_num * 1.3 }); if(size != 's') { @@ -1923,42 +1928,10 @@ function svg_edit_setup() { updateToolButtonState(); }); -// (function() { -// var timer, menuShown; -// $('#tools_rect_show').mousedown(function(evt){ -// timer = setTimeout(function() { -// // menuShown = true; -// $('#tools_rect').show(); -// },200); -// // this prevents the 'image drag' behavior in Firefox -// evt.preventDefault(); -// }).mouseup(function() { -// clearTimeout(timer); -// // var opt = $(this).attr('data-curopt',); -// }); -// -// -// // $('#tools_rect').mouseleave(function(){$('#tools_rect').fadeOut();}); -// -// }()); - $('#tool_move_top').mousedown(function(evt){ $('#tools_stacking').show(); evt.preventDefault(); }); - -// $('#tools_ellipse_show').mousedown(function(evt){ -// $('#tools_ellipse').show(); -// // this prevents the 'image drag' behavior in Firefox -// evt.preventDefault(); -// }); -// $('#tools_ellipse').mouseleave(function() {$('#tools_ellipse').fadeOut();}); - -// $('.tool_flyout_button').mouseover(function() { -// $(this).addClass('tool_flyout_button_current'); -// }).mouseout(function() { -// $(this).removeClass('tool_flyout_button_current'); -// }); $('.layer_button').mousedown(function() { $(this).addClass('layer_buttonpressed'); @@ -2766,6 +2739,16 @@ function svg_edit_setup() { svgCanvas.setIconSize('s'); } + // Look for any missing flyout icons from plugins + $('.tools_flyout').each(function() { + var shower = $('#' + this.id + '_show'); + var sel = shower.attr('data-curopt'); + // Check if there's an icon here + if(!shower.children('svg, img').length) { + shower.append($(sel).children().clone()); + } + }); + // Load source if given var loc = document.location.href; if(loc.indexOf('?source=') != -1) {