mirror of
https://github.com/dqjdda/Aurora.git
synced 2018-11-06 05:33:29 +00:00
修复设置主题,刷新后失效的bug,修复主题失效的bug
This commit is contained in:
@@ -153,23 +153,19 @@
|
||||
</div>
|
||||
<script th:src="@{'/js/jquery.min.js'}"></script>
|
||||
<script>
|
||||
/**
|
||||
* 默认选中状态
|
||||
* @type {string}
|
||||
*/
|
||||
var themeKey = 'KITADMIN_SETTING_THEME';
|
||||
var theme = localStorage.getItem(themeKey);
|
||||
|
||||
if(theme == null){
|
||||
$("input[name='setting-theme']")[0].attr("checked","checked");
|
||||
} else {
|
||||
var themeName = $.parseJSON(theme).theme;
|
||||
$(function () {
|
||||
var themeKey = 'KITADMIN_SETTING_THEME';
|
||||
var theme = localStorage.getItem(themeKey);
|
||||
var themeName = "default"
|
||||
if(theme != null){
|
||||
themeName = $.parseJSON(theme).theme;
|
||||
}
|
||||
$("input[name='setting-theme']").each(function () {
|
||||
if($(this).parent().attr("data-theme") == themeName){
|
||||
$(this).attr("checked","checked");
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
layui.use(['form', 'utils'], function () {
|
||||
var form = layui.form,
|
||||
$ = layui.jquery,
|
||||
|
||||
@@ -129,9 +129,8 @@
|
||||
*/
|
||||
var themeKey = 'KITADMIN_SETTING_THEME';
|
||||
var theme = localStorage.getItem(themeKey);
|
||||
var themeName = ""
|
||||
if(theme != null){
|
||||
themeName = $.parseJSON(theme).theme;
|
||||
var themeName = $.parseJSON(theme).theme;
|
||||
var str = $('#theme').attr('href');
|
||||
var _themeUrl = str.substr(0, str.lastIndexOf('/') + 1);
|
||||
$('#theme').attr('href', _themeUrl + themeName + '.css');
|
||||
|
||||
Reference in New Issue
Block a user