Made tab/shift+tab cycle through elements as long as no input field is focused
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1749 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -524,7 +524,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="tools_bottom_3">
|
<div id="tools_bottom_3">
|
||||||
<div id="palette_holder"><div id="palette" title="Click to change fill color, shift-click to change stroke color"></div></div>
|
<div id="palette_holder" tabindex="-1"><div id="palette" title="Click to change fill color, shift-click to change stroke color"></div></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="copyright"><span id="copyrightLabel">Powered by</span> <a href="http://svg-edit.googlecode.com/" target="_blank">SVG-edit v2.6-preAlpha</a></div>
|
<div id="copyright"><span id="copyrightLabel">Powered by</span> <a href="http://svg-edit.googlecode.com/" target="_blank">SVG-edit v2.6-preAlpha</a></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -463,7 +463,8 @@
|
|||||||
layer_menu = $("#cmenu_layers"),
|
layer_menu = $("#cmenu_layers"),
|
||||||
show_save_warning = false,
|
show_save_warning = false,
|
||||||
exportWindow = null,
|
exportWindow = null,
|
||||||
tool_scale = 1;
|
tool_scale = 1,
|
||||||
|
ui_context = 'toolbars';
|
||||||
|
|
||||||
// This sets up alternative dialog boxes. They mostly work the same way as
|
// This sets up alternative dialog boxes. They mostly work the same way as
|
||||||
// their UI counterparts, expect instead of returning the result, a callback
|
// their UI counterparts, expect instead of returning the result, a callback
|
||||||
@@ -633,6 +634,7 @@
|
|||||||
// called when we've selected a different element
|
// called when we've selected a different element
|
||||||
var selectedChanged = function(window,elems) {
|
var selectedChanged = function(window,elems) {
|
||||||
var mode = svgCanvas.getMode();
|
var mode = svgCanvas.getMode();
|
||||||
|
if(mode === "select") setSelectMode();
|
||||||
var is_node = (mode == "pathedit");
|
var is_node = (mode == "pathedit");
|
||||||
// if elems[1] is present, then we have more than one element
|
// if elems[1] is present, then we have more than one element
|
||||||
selectedElement = (elems.length == 1 || elems[1] == null ? elems[0] : null);
|
selectedElement = (elems.length == 1 || elems[1] == null ? elems[0] : null);
|
||||||
@@ -2180,19 +2182,19 @@
|
|||||||
$(inp).blur();
|
$(inp).blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not include the #text input, as it needs to remain focused
|
$('#svg_editor').find('button, select, input:not(#text)').focus(function() {
|
||||||
// when clicking on an SVG text element.
|
|
||||||
$('#svg_editor input:text:not(#text)').focus(function() {
|
|
||||||
inp = this;
|
inp = this;
|
||||||
|
ui_context = 'toolbars';
|
||||||
workarea.mousedown(unfocus);
|
workarea.mousedown(unfocus);
|
||||||
}).blur(function() {
|
}).blur(function() {
|
||||||
|
ui_context = 'canvas';
|
||||||
workarea.unbind('mousedown', unfocus);
|
workarea.unbind('mousedown', unfocus);
|
||||||
|
|
||||||
// Go back to selecting text if in textedit mode
|
// Go back to selecting text if in textedit mode
|
||||||
if(svgCanvas.getMode() == 'textedit') {
|
if(svgCanvas.getMode() == 'textedit') {
|
||||||
$('#text').focus();
|
$('#text').focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
var clickSelect = function() {
|
var clickSelect = function() {
|
||||||
@@ -3771,6 +3773,18 @@
|
|||||||
function(evt) {$(this).change();evt.preventDefault();}
|
function(evt) {$(this).change();evt.preventDefault();}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$(window).bind('keydown', 'tab', function(e) {
|
||||||
|
if(ui_context === 'canvas') {
|
||||||
|
e.preventDefault();
|
||||||
|
selectNext();
|
||||||
|
}
|
||||||
|
}).bind('keydown', 'shift+tab', function(e) {
|
||||||
|
if(ui_context === 'canvas') {
|
||||||
|
e.preventDefault();
|
||||||
|
selectPrev();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#tool_zoom').dblclick(dblclickZoom);
|
$('#tool_zoom').dblclick(dblclickZoom);
|
||||||
},
|
},
|
||||||
setTitles: function() {
|
setTitles: function() {
|
||||||
|
|||||||
@@ -4196,8 +4196,8 @@ var removeFromSelection = this.removeFromSelection = function(elemsToRemove) {
|
|||||||
// Clears the selection, then adds all elements in the current layer to the selection.
|
// Clears the selection, then adds all elements in the current layer to the selection.
|
||||||
this.selectAllInCurrentLayer = function() {
|
this.selectAllInCurrentLayer = function() {
|
||||||
if (current_layer) {
|
if (current_layer) {
|
||||||
selectOnly($(current_group || current_layer).children());
|
|
||||||
current_mode = "select";
|
current_mode = "select";
|
||||||
|
selectOnly($(current_group || current_layer).children());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -11107,6 +11107,7 @@ this.cycleElement = function(next) {
|
|||||||
var cur_elem = selectedElements[0];
|
var cur_elem = selectedElements[0];
|
||||||
var elem = false;
|
var elem = false;
|
||||||
var all_elems = getVisibleElements(current_group || current_layer);
|
var all_elems = getVisibleElements(current_group || current_layer);
|
||||||
|
if(!all_elems.length) return;
|
||||||
if (cur_elem == null) {
|
if (cur_elem == null) {
|
||||||
var num = next?all_elems.length-1:0;
|
var num = next?all_elems.length-1:0;
|
||||||
elem = all_elems[num];
|
elem = all_elems[num];
|
||||||
|
|||||||
Reference in New Issue
Block a user