Now can use tab and shift-tab in Suggest_pulldown, as alternative to down and up keys.
This commit is contained in:
parent
32f72e5a36
commit
3951d147b3
3
NEWS
3
NEWS
|
@ -1,3 +1,6 @@
|
||||||
|
1.4.10: June ?, 2008:
|
||||||
|
* New suggest-as-you-type feature for creating links.
|
||||||
|
|
||||||
1.4.9: June 25, 2008:
|
1.4.9: June 25, 2008:
|
||||||
* When linking to a note by title, the note resolution is now
|
* When linking to a note by title, the note resolution is now
|
||||||
case-insensitive instead of case-sensitive.
|
case-insensitive instead of case-sensitive.
|
||||||
|
|
|
@ -993,9 +993,11 @@ Wiki.prototype.editor_key_pressed = function ( editor, event ) {
|
||||||
}
|
}
|
||||||
// IE: hitting space or tab while making a link shouldn't end the link
|
// IE: hitting space or tab while making a link shouldn't end the link
|
||||||
} else if ( ( code == 32 || code == 9 ) && editor.document.selection && editor.state_enabled( "a" ) ) {
|
} else if ( ( code == 32 || code == 9 ) && editor.document.selection && editor.state_enabled( "a" ) ) {
|
||||||
var range = editor.document.selection.createRange();
|
if ( code == 32 ) {
|
||||||
var text = range.parentElement().firstChild;
|
var range = editor.document.selection.createRange();
|
||||||
text.nodeValue += " ";
|
var text = range.parentElement().firstChild;
|
||||||
|
text.nodeValue += " ";
|
||||||
|
}
|
||||||
event.stop();
|
event.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3442,8 +3444,8 @@ Suggest_pulldown.prototype.key_pressed = function ( event ) {
|
||||||
|
|
||||||
var code = event.key().code;
|
var code = event.key().code;
|
||||||
|
|
||||||
// up arrow: move up to the previous suggestion
|
// up arrow or shift-tab: move up to the previous suggestion
|
||||||
if ( code == 38 ) {
|
if ( code == 38 || ( code == 9 && event.modifier().shift ) ) {
|
||||||
var selected = getFirstElementByTagAndClassName( "div", "selected_suggestion", this.div );
|
var selected = getFirstElementByTagAndClassName( "div", "selected_suggestion", this.div );
|
||||||
|
|
||||||
// if something is selected and there's a previous suggestion in the list, move the selection up
|
// if something is selected and there's a previous suggestion in the list, move the selection up
|
||||||
|
@ -3454,8 +3456,8 @@ Suggest_pulldown.prototype.key_pressed = function ( event ) {
|
||||||
} else {
|
} else {
|
||||||
addElementClass( this.div, "invisible" );
|
addElementClass( this.div, "invisible" );
|
||||||
}
|
}
|
||||||
// down arrow: move down to the previous suggestion
|
// down arrow or tab: move down to the previous suggestion
|
||||||
} else if ( code == 40 ) {
|
} else if ( code == 40 || code == 9 ) {
|
||||||
var selected = getFirstElementByTagAndClassName( "div", "selected_suggestion", this.div );
|
var selected = getFirstElementByTagAndClassName( "div", "selected_suggestion", this.div );
|
||||||
|
|
||||||
// if something is selected and there's a next suggestion in the list, move the selection down
|
// if something is selected and there's a next suggestion in the list, move the selection down
|
||||||
|
|
Reference in New Issue