Select Saved SVG

When closing SVG-Edit, make the saved
svg selected.

Also, some SVG-Edit updates.
This commit is contained in:
Jacques Distler 2010-05-11 00:38:21 -05:00
parent fd9fc1455e
commit 04a1727082
67 changed files with 3996 additions and 2823 deletions

View file

@ -142,11 +142,25 @@ function setupSVGedit(path){
if(event.origin !== my_loc) { return;}
t.value = before + event.data + after;
t.focus();
selectRange(t, before.length, before.length+event.data.length);
SVGeditButton.disabled = true;
SVGeditButton.value = 'Create SVG graphic';
});
}
function selectRange(elt, start, end) {
if (elt.setSelectionRange) {
elt.focus();
elt.setSelectionRange(start, end);
} else if (elt.createTextRange) {
var range = elt.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', start);
range.select();
}
}
function updateSize(elt, w, h) {
// adjust to the size of the user's browser area.
// w and h are the original, unadjusted, width and height per row/column