mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
Make CSS preloadable, move some CSS out of header
This commit is contained in:
parent
9dab8a502f
commit
77e365985f
10
js/grocy.js
10
js/grocy.js
|
|
@ -252,7 +252,7 @@ class GrocyClass
|
|||
}
|
||||
}
|
||||
|
||||
PreloadView(viewName, cb = () => { })
|
||||
PreloadView(viewName, loadCSS = false, cb = () => { })
|
||||
{
|
||||
if (!Object.prototype.hasOwnProperty.call(window, viewName + "View"))
|
||||
{
|
||||
|
|
@ -262,6 +262,14 @@ class GrocyClass
|
|||
url: this.FormatUrl('/viewjs/' + viewName + '.js'),
|
||||
success: cb
|
||||
});
|
||||
if (loadCSS)
|
||||
{
|
||||
$("<link/>", {
|
||||
rel: "stylesheet",
|
||||
type: "text/css",
|
||||
href: this.FormatUrl('/css/viewcss/' + viewName + '.cs')
|
||||
}).appendTo("head");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,4 +11,16 @@
|
|||
}
|
||||
#barcodescanner-livestream canvas {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#barcodescanner-start-button {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.combobox-container #barcodescanner-start-button {
|
||||
margin-right: 36px !important;
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
@if (!GROCY_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING)
|
||||
|
||||
@push('pageStyles')
|
||||
<style>
|
||||
#barcodescanner-start-button {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.combobox-container #barcodescanner-start-button {
|
||||
margin-right: 36px !important;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@endif
|
||||
5
views/layout/json.blade.php
Normal file
5
views/layout/json.blade.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
@php
|
||||
// this is a shoe-horned method to generate a "proper" subview as JSON.
|
||||
|
||||
|
||||
@endphp
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
RecipePictureFileName: '{{ $recipe->picture_file_name }}',
|
||||
@endif
|
||||
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user