mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Nicer focus handling for asset search
This commit is contained in:
parent
6e006a6873
commit
f844bf4b41
|
@ -81,8 +81,13 @@ class AssetsController extends Controller
|
|||
* @return Redirect
|
||||
*/
|
||||
public function getAssetByTag() {
|
||||
if (Input::get('topsearch')=="true") {
|
||||
$topsearch = true;
|
||||
} else {
|
||||
$topsearch = false;
|
||||
}
|
||||
if ($asset = Asset::where('asset_tag','=',Input::get('assetTag'))->first()) {
|
||||
return redirect()->route('view/hardware', $asset->id);
|
||||
return redirect()->route('view/hardware', $asset->id)->with('topsearch', $topsearch);
|
||||
}
|
||||
return redirect()->to('hardware')->with('error',trans('admin/hardware/message.does_not_exist'));
|
||||
|
||||
|
|
|
@ -575,10 +575,11 @@
|
|||
|
||||
@section('moar_scripts')
|
||||
@show
|
||||
|
||||
@if ((Session::get('topsearch')=='true') || (Request::is('/')))
|
||||
<script>
|
||||
// $("#tagSearch").focus();
|
||||
$("#tagSearch").focus();
|
||||
</script>
|
||||
@endif
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue