Closed gyygyy32 closed 6 years ago
fine _layout.cshtml under view and change "blue" to "purple" in this line
themeCookie.Value.IsEmptyOrNull() ? themeCookie.Value : "blue";
Another possible solution (if you want a permanent theme) :
insert
if (!$('#s-DashboardPage').length)
return;
//make skin-blue-light the default
$('#s-DashboardPage').addClass("skin-blue-light");
insert
//Fix for IE page transitions
$("body").removeClass("hold-transition");
//make skin-blue-light the default
$("body").addClass("skin-blue-light");
change
event of select
in ThemeSelection.ts at \Modules\Common\Navigation folderor create a helper:
namespace YourNamespace {
export class UIHelper {
static getCurrentSerenityTheme = function () {
var skinClass = Q.first(($('body').attr('class') || '').split(' '), function (x) { return Q.startsWith(x, 'skin-'); });
if (skinClass) {
return skinClass.substr(5);
}
return 'blue';
};
static setTheme(themeKey: string) {
var path = Q.Config.applicationPath;
if (path && path != '/' && Q.endsWith(path, '/'))
path = path.substr(0, path.length - 1);
$.cookie('ThemePreference', themeKey, {
path: path,
expires: 365
});
var theme = themeKey || '';
var darkSidebar = theme.indexOf('light') < 0;
$('body').removeClass('skin-' + this.getCurrentSerenityTheme());
$('body').addClass('skin-' + theme)
.toggleClass('dark-sidebar', darkSidebar)
.toggleClass('light-sidebar', !darkSidebar);
}
}
}
and use:
YourNamespace.UIHelper.setTheme('red-light');
Thanks on behalf of @gyygyy32
Like the purple theme