mirror of https://github.com/ColorlibHQ/AdminLTE
add dark-mode checkbox in demo.js
parent
3311b2ca92
commit
04d78d238b
|
@ -223,9 +223,24 @@
|
|||
$('.brand-link').removeClass('text-sm')
|
||||
}
|
||||
})
|
||||
var $text_sm_brand_container = $('<div />', { class: 'mb-4' }).append($text_sm_brand_checkbox).append('<span>Brand small text</span>')
|
||||
var $text_sm_brand_container = $('<div />', { class: 'mb-1' }).append($text_sm_brand_checkbox).append('<span>Brand small text</span>')
|
||||
$container.append($text_sm_brand_container)
|
||||
|
||||
var $dark_mode_checkbox = $('<input />', {
|
||||
type: 'checkbox',
|
||||
value: 1,
|
||||
checked: $('body').hasClass('dark-mode'),
|
||||
class: 'mr-1'
|
||||
}).on('click', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('body').addClass('dark-mode')
|
||||
} else {
|
||||
$('body').removeClass('dark-mode')
|
||||
}
|
||||
})
|
||||
var $dark_mode_container = $('<div />', { class: 'mb-4' }).append($dark_mode_checkbox).append('<span>Dark Mode</span>')
|
||||
$container.append($dark_mode_container)
|
||||
|
||||
$container.append('<h6>Navbar Variants</h6>')
|
||||
|
||||
var $navbar_variants = $('<div />', {
|
||||
|
|
Loading…
Reference in New Issue