admin: autofocus search fields

This commit is contained in:
nemunaire 2018-01-08 00:41:23 +01:00
parent beba0a615f
commit 1b852f255e
8 changed files with 19 additions and 7 deletions

View File

@ -67,6 +67,18 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"])
$locationProvider.html5Mode(true);
});
angular.module("FICApp")
.directive('autofocus', ['$timeout', function($timeout) {
return {
restrict: 'A',
link : function($scope, $element) {
$timeout(function() {
$element[0].focus();
});
}
}
}]);
angular.module("FICApp")
.factory("Version", function($resource) {
return $resource("/api/version")

View File

@ -4,7 +4,7 @@
<button ng-click="show('new')" class="float-right btn btn-sm btn-primary" style="margin-right: 10px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un événement</button>
</h2>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>

View File

@ -12,7 +12,7 @@
</div>
<div>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>

View File

@ -3,7 +3,7 @@
<button ng-click="checksumAll()" class="float-right btn btn-sm btn-secondary mr-sm-2"><span class="glyphicon glyphicon-flash" aria-hidden="true"></span> Vérifier les fichiers</button>
</h2>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>

View File

@ -5,7 +5,7 @@
<button ng-click="show('export')" class="float-right btn btn-sm btn-secondary" style="margin-right: 10px;"><span class="glyphicon glyphicon-export" aria-hidden="true"></span> Statistiques générales</button>
</h2>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>

View File

@ -1,6 +1,6 @@
<h2 ng-controller="SettingsController">{{ config.title }} &ndash; &Eacute;quipes</h2>
<p class="hidden-print"><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<p class="hidden-print"><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered">
<thead>

View File

@ -4,7 +4,7 @@
<button ng-click="sync()" ng-class="{'disabled': inSync}" class="float-right btn btn-sm btn-secondary" style="margin-right: 10px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</button>
</h2>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered table-striped">
<thead class="thead-dark">
<tr>

View File

@ -26,7 +26,7 @@
<button ng-click="syncExo()" ng-class="{'disabled': inSync}" class="float-right btn btn-sm btn-light"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</button>
</h3>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>