let delete shortcut work on empty preset search

This commit is contained in:
Ansis Brammanis
2013-03-04 11:29:03 -05:00
parent 8aaa91d96f
commit 4a9ce55793
16 changed files with 28 additions and 15 deletions
+3
View File
@@ -11,6 +11,9 @@ iD.ui.Inspector = function(context) {
var presetGrid = iD.ui.PresetGrid(context)
.entity(entity)
.on('close', function() {
event.close();
})
.on('choose', function(preset) {
inspectorbody.call(tagEditor, preset);
});
+11 -1
View File
@@ -1,5 +1,5 @@
iD.ui.PresetGrid = function(context) {
var event = d3.dispatch('choose'),
var event = d3.dispatch('choose', 'close'),
entity,
presets = context.presets(),
taginfo = iD.taginfo();
@@ -26,6 +26,16 @@ iD.ui.PresetGrid = function(context) {
var search = searchwrap.append('input')
.attr('class', 'preset-grid-search')
.attr('type', 'search')
.on('keydown', function() {
// hack to let delete shortcut work when search is autofocused
if (d3.event.keyCode === 46 && search.property('value').length === 0) {
annotation = t('operations.delete.annotation.' + context.geometry(entity.id));
context.perform(
iD.actions.DeleteMultiple([entity.id]),
annotation);
event.close();
}
})
.on('keyup', function() {
// enter
var value = search.property('value');
+1 -1
View File
@@ -73,7 +73,7 @@ locale.da = {
'delete': {
title: "Slet",
description: "Fjern dette fra kortet.",
key: "",
key: "",
annotation: {
point: "Slettede et punkt.",
vertex: "Slettede en node fra en vej.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.de = {
'delete': {
title: "Löschen",
description: "Lösche dies aus der Karte.",
key: "",
key: "",
annotation: {
point: "Punkt gelöscht.",
vertex: "Stützpunkt aus einem Weg gelöscht.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.en = {
'delete': {
title: "Delete",
description: "Remove this from the map.",
key: "",
key: "",
annotation: {
point: "Deleted a point.",
vertex: "Deleted a node from a way.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.es = {
'delete': {
title: "Eliminar", //"Delete",
description: "Eliminar del mapa.", //"Remove this from the map.",
key: "",
key: "",
annotation: {
point: "Punto eliminado.", //"Deleted a point.",
vertex: "Vértice elimnado de la ruta.", //"Deleted a node from a way.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.fr = {
'delete': {
title: "Supprimer",
description: "Supprime l'élément de la carte.",
key: "",
key: "",
annotation: {
point: "Supprime un point.",
vertex: "Supprime le noeud d'une ligne.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.it = {
'delete': {
title: "Cancella",
description: "Cancella questo dalla mappa.",
key: "",
key: "",
annotation: {
point: "Cancellato un punto.",
vertex: "Cancellato un punto da una linea.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.ja = {
'delete': {
title: "削除",
description: "この地物をマップから削除",
key: "",
key: "",
annotation: {
point: "ポイントを削除",
vertex: "ウェイ上のノードを削除",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.lv = {
'delete': {
title: "Dzēst",
description: "Izdzēst no kartes.",
key: "",
key: "",
annotation: {
point: "Punkts dzēsts.",
vertex: "Mezgls dzests.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.nl = {
'delete': {
title: "Verwijderen",
description: "Verwijder dit van de kaart.",
key: "",
key: "",
annotation: {
point: "Punt verwijderd.",
vertex: "Knoop uit een weg verwijderd.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.pl = {
'delete': {
title: "Usuń",
description: "Usuń to z mapy.",
key: "",
key: "",
annotation: {
point: "Usunięto punkt.",
vertex: "Usunięto węzeł z drogi.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.ru = {
'delete': {
title: "Удалить",
description: "Убрать объект с карты.",
key: "",
key: "",
annotation: {
point: "Удалена точка.",
vertex: "Удалёна точка из линии.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.tr = {
'delete': {
title: "Sil",
description: "Haritan bunu sil.",
key: "",
key: "",
annotation: {
point: "Bir nokta silindi.",
vertex: "Yoldan bir nod silindi.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.uk = {
'delete': {
title: "Вилучити",
description: "Вилучити об’єкт з мапи.",
key: "",
key: "",
annotation: {
point: "Вилучено точку.",
vertex: "Вилучено точку з лінії.",
+1 -1
View File
@@ -73,7 +73,7 @@ locale.vi = {
'delete': {
title: "Xóa",
description: "Xóa đối tượng này khỏi bản đồ.",
key: "",
key: "",
annotation: {
point: "Xóa địa điểm.",
vertex: "Xóa nốt khỏi lối.",