Browse Source

dark mode

jqh 4 years ago
parent
commit
0d1a172371

+ 0 - 4
resources/assets/dcat/js/extensions/DarkMode.js

@@ -12,10 +12,6 @@ export default class DarkMode {
         };
 
         Dcat.darkMode = this;
-
-        if (this.options.dark_mode) {
-            this.switch(true)
-        }
     }
 
     toggle() {

File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


+ 2 - 2
resources/views/layouts/full-page.blade.php

@@ -20,10 +20,10 @@
 
     {!! admin_section(\AdminSection::HEAD) !!}
 
-    {!! Dcat\Admin\Admin::asset()->cssToHtml() !!}
-
     {!! Dcat\Admin\Admin::asset()->headerJsToHtml() !!}
 
+    {!! Dcat\Admin\Admin::asset()->cssToHtml() !!}
+
     @yield('head')
 </head>
 

+ 2 - 2
resources/views/layouts/page.blade.php

@@ -20,10 +20,10 @@
 
     {!! admin_section(\AdminSection::HEAD) !!}
 
-    {!! Dcat\Admin\Admin::asset()->cssToHtml() !!}
-
     {!! Dcat\Admin\Admin::asset()->headerJsToHtml() !!}
 
+    {!! Dcat\Admin\Admin::asset()->cssToHtml() !!}
+
     <!--[if lt IE 9]>
     <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>

+ 5 - 0
src/Layout/Content.php

@@ -6,6 +6,7 @@ use Closure;
 use Dcat\Admin\Admin;
 use Dcat\Admin\Traits\HasBuilderEvents;
 use Illuminate\Contracts\Support\Renderable;
+use Illuminate\Support\Str;
 use Illuminate\Support\Traits\Macroable;
 use Illuminate\Support\ViewErrorBag;
 
@@ -505,6 +506,10 @@ JS
             }
         }
 
+        if ($data['body_class'] && Str::contains($data['body_class'], 'dark-mode')) {
+            $data['sidebar_dark'] = true;
+        }
+
         return [
             'theme' => $data['theme'],
             'sidebar_collapsed' => $data['sidebar_collapsed'],

Some files were not shown because too many files changed in this diff