mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #1950 from Damiya/1893-fix
Enable Escape key to close tag suggestion popup
This commit is contained in:
commit
9715e1994d
1 changed files with 6 additions and 6 deletions
|
@ -134,6 +134,12 @@
|
||||||
var $target = $(e.currentTarget),
|
var $target = $(e.currentTarget),
|
||||||
searchTerm = $.trim($target.val());
|
searchTerm = $.trim($target.val());
|
||||||
|
|
||||||
|
if (searchTerm) {
|
||||||
|
this.showSuggestions($target, searchTerm);
|
||||||
|
} else {
|
||||||
|
this.$suggestions.hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (e.keyCode === this.keys.UP) {
|
if (e.keyCode === this.keys.UP) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (this.$suggestions.is(":visible")) {
|
if (this.$suggestions.is(":visible")) {
|
||||||
|
@ -159,12 +165,6 @@
|
||||||
if (e.keyCode === this.keys.UP || e.keyCode === this.keys.DOWN) {
|
if (e.keyCode === this.keys.UP || e.keyCode === this.keys.DOWN) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchTerm) {
|
|
||||||
this.showSuggestions($target, searchTerm);
|
|
||||||
} else {
|
|
||||||
this.$suggestions.hide();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleKeydown: function (e) {
|
handleKeydown: function (e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue