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">
|
<form class="form-inline">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="query-tickets">{{'Search:' | translate}}</label>
|
<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>
|
</div> <label> <input type="checkbox" ng-model="registeredFilterOptions.all" /> {{'Show cancelled tickets' | translate}}</label>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</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) {}
|
} catch(err) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.resetInput = function() {
|
||||||
|
$scope.query = "";
|
||||||
|
};
|
||||||
|
|
||||||
$scope.$on('$destroy', function() {
|
$scope.$on('$destroy', function() {
|
||||||
$scope.EventUpdates && $scope.EventUpdates.close();
|
$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 {
|
:not(.no-leave)#toast-container > div.ng-leave {
|
||||||
transition-duration: .2s;
|
transition-duration: .2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.query-input {
|
||||||
|
min-width: 400px;
|
||||||
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
"Attendees:": "Partecipanti:",
|
"Attendees:": "Partecipanti:",
|
||||||
"Registered:": "Registrato:",
|
"Registered:": "Registrato:",
|
||||||
"Search:": "Cerca:",
|
"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",
|
"Show cancelled tickets": "Mostra i biglietti cancellati",
|
||||||
"filtered item/s": "elementi filtrati",
|
"filtered item/s": "elementi filtrati",
|
||||||
"export CSV": "esporta in CSV",
|
"export CSV": "esporta in CSV",
|
||||||
|
@ -91,6 +91,7 @@
|
||||||
"Join again this event": "Partecipa di nuovo a questo evento",
|
"Join again this event": "Partecipa di nuovo a questo evento",
|
||||||
"All Tickets": "Tutti i biglietti",
|
"All Tickets": "Tutti i biglietti",
|
||||||
"Tickets:": "Biglietti",
|
"Tickets:": "Biglietti",
|
||||||
|
"Name or email": "Nome o email",
|
||||||
"update user information": "aggiorna le informazioni dell'utente",
|
"update user information": "aggiorna le informazioni dell'utente",
|
||||||
"Old password": "Vecchia password",
|
"Old password": "Vecchia password",
|
||||||
"New password": "Nuova password",
|
"New password": "Nuova password",
|
||||||
|
|
Loading…
Reference in a new issue