mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -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
|
* @return Redirect
|
||||||
*/
|
*/
|
||||||
public function getAssetByTag() {
|
public function getAssetByTag() {
|
||||||
|
if (Input::get('topsearch')=="true") {
|
||||||
|
$topsearch = true;
|
||||||
|
} else {
|
||||||
|
$topsearch = false;
|
||||||
|
}
|
||||||
if ($asset = Asset::where('asset_tag','=',Input::get('assetTag'))->first()) {
|
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'));
|
return redirect()->to('hardware')->with('error',trans('admin/hardware/message.does_not_exist'));
|
||||||
|
|
||||||
|
|
|
@ -575,10 +575,11 @@
|
||||||
|
|
||||||
@section('moar_scripts')
|
@section('moar_scripts')
|
||||||
@show
|
@show
|
||||||
|
@if ((Session::get('topsearch')=='true') || (Request::is('/')))
|
||||||
<script>
|
<script>
|
||||||
// $("#tagSearch").focus();
|
$("#tagSearch").focus();
|
||||||
</script>
|
</script>
|
||||||
|
@endif
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue