Nicer focus handling for asset search

This commit is contained in:
snipe 2016-05-24 01:10:05 -07:00
parent 6e006a6873
commit f844bf4b41
2 changed files with 9 additions and 3 deletions

View file

@ -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'));

View file

@ -575,10 +575,11 @@
@section('moar_scripts')
@show
@if ((Session::get('topsearch')=='true') || (Request::is('/')))
<script>
// $("#tagSearch").focus();
$("#tagSearch").focus();
</script>
@endif
</body>
</html>