From 718427a32dcdc1b43820b2724e7adf5c9a6f03c7 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Wed, 23 Dec 2009 18:31:38 +0000 Subject: [PATCH] Added resize handles to text elements, minor code cleanup git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1102 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 12 ++++-------- editor/svgcanvas.js | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 2e985990..250a6208 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -92,7 +92,7 @@ function svg_edit_setup() { // needs to be included that returns the result as its first parameter. // In the future we may want to add additional types of dialog boxes, since // they should be easy to handle this way. - var setDialogs = function() { + function() { $('#dialog_container').draggable({cancel:'#dialog_content, #dialog_buttons *'}); var box = $('#dialog_box'), btn_holder = $('#dialog_buttons'); @@ -129,9 +129,7 @@ function svg_edit_setup() { $.alert = function(msg, cb) { dbox('alert', msg, cb);}; $.confirm = function(msg, cb) { dbox('confirm', msg, cb);}; $.prompt = function(msg, txt, cb) { dbox('prompt', msg, cb, txt);}; - } - - setDialogs(); + }(); var setSelectMode = function() { $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); @@ -1422,7 +1420,7 @@ function svg_edit_setup() { // added these event handlers for all the push buttons so they // behave more like buttons being pressed-in and not images - function setPushButtons() { + function() { var toolnames = ['clear','open','save','source','delete','delete_multi','paste','clone','clone_multi','move_top','move_bottom']; var all_tools = ''; var cur_class = 'tool_button_current'; @@ -1442,9 +1440,7 @@ function svg_edit_setup() { }).bind('mousedown mouseout',function(){ $(this).removeClass(cur_class);} ); - } - - setPushButtons(); + }(); $('#workarea').bind("mousewheel DOMMouseScroll", function(e){ if(!e.shiftKey) return; diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index e032ea2f..b52e5271 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -383,7 +383,6 @@ function BatchCommand(text) { this.rotateGrip.setAttribute("display", bShow); this.rotateGripConnector.setAttribute("display", bShow); var elem = this.selectedElement; - if(elem && (elem.tagName == "text")) bShow = "none";// || elem.tagName == "g")) bShow = "none"; for (dir in this.selectorGrips) { this.selectorGrips[dir].setAttribute("display", bShow); }