fixes #181: press ESC to reset input field (list of tickets only)
This commit is contained in:
parent
1047dc47b4
commit
c3f93609c1
5 changed files with 24 additions and 2 deletions
|
@ -28,7 +28,7 @@
|
|||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label for="query-tickets">{{'Search:' | translate}}</label>
|
||||
<input eventman-focus type="text" id="query-tickets" class="form-control" placeholder="{{'Name or email' | translate}}" ng-model="query" ng-model-options="{debounce: 350}">
|
||||
<input eventman-focus type="text" id="query-tickets" class="form-control query-input" placeholder="{{'Name or email or key:value' | translate}}" ng-model="query" ng-model-options="{debounce: 350}" esc-key="resetInput()">
|
||||
</div> <label> <input type="checkbox" ng-model="registeredFilterOptions.all" /> {{'Show cancelled tickets' | translate}}</label>
|
||||
</form>
|
||||
</div>
|
||||
|
|
4
angular_app/js/controllers.js
vendored
4
angular_app/js/controllers.js
vendored
|
@ -705,6 +705,10 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
|
|||
} catch(err) {}
|
||||
};
|
||||
|
||||
$scope.resetInput = function() {
|
||||
$scope.query = "";
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
$scope.EventUpdates && $scope.EventUpdates.close();
|
||||
});
|
||||
|
|
13
angular_app/js/directives.js
vendored
13
angular_app/js/directives.js
vendored
|
@ -40,3 +40,16 @@ eventManApp.directive('resetFocus', function () {
|
|||
};
|
||||
});
|
||||
|
||||
|
||||
eventManApp.directive('escKey', function() {
|
||||
return function(scope, element, attrs) {
|
||||
element.bind('keydown keypress', function(evt) {
|
||||
if (evt.which === 27) {
|
||||
scope.$apply(function() {
|
||||
scope.$eval(attrs.escKey);
|
||||
});
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
@ -111,3 +111,7 @@ input[type=text].form-control, input[type=search].form-control {
|
|||
:not(.no-leave)#toast-container > div.ng-leave {
|
||||
transition-duration: .2s;
|
||||
}
|
||||
|
||||
.query-input {
|
||||
min-width: 400px;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"Attendees:": "Partecipanti:",
|
||||
"Registered:": "Registrato:",
|
||||
"Search:": "Cerca:",
|
||||
"Name or email": "Nome o email",
|
||||
"Name or email or key:value": "Nome, email o chiave:valore",
|
||||
"Show cancelled tickets": "Mostra i biglietti cancellati",
|
||||
"filtered item/s": "elementi filtrati",
|
||||
"export CSV": "esporta in CSV",
|
||||
|
@ -91,6 +91,7 @@
|
|||
"Join again this event": "Partecipa di nuovo a questo evento",
|
||||
"All Tickets": "Tutti i biglietti",
|
||||
"Tickets:": "Biglietti",
|
||||
"Name or email": "Nome o email",
|
||||
"update user information": "aggiorna le informazioni dell'utente",
|
||||
"Old password": "Vecchia password",
|
||||
"New password": "Nuova password",
|
||||
|
|
Loading…
Reference in a new issue