Navigation Menu

Skip to content

Commit

Permalink
AdminLTE 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyouworld committed May 12, 2020
1 parent 07480aa commit c5e5631
Show file tree
Hide file tree
Showing 207 changed files with 16,613 additions and 6,603 deletions.
2 changes: 1 addition & 1 deletion AdminLTE-3.x/README.md
Expand Up @@ -79,7 +79,7 @@ git clone https://github.com/ColorlibHQ/AdminLTE.git
要编译 dist 文件,你需要 nodejs/npm,克隆/下载仓库,然后:

1. `npm install` (安装 npm)
2. _可选:_ `npm dev` (开发人员模式,支持实时演示、自动编译、浏览器同步)
2. _可选:_ `npm run dev` (开发人员模式,支持实时演示、自动编译、浏览器同步)
3. `npm run production` (编译 css/js 文件)

#### 贡献要求:
Expand Down
5 changes: 3 additions & 2 deletions AdminLTE-3.x/build/js/CardWidget.js
Expand Up @@ -70,7 +70,8 @@ const CardWidget = (($) => {
.slideUp(this._settings.animationSpeed, () => {
this._parent.addClass(ClassName.COLLAPSED)
})
this._parent.find(this._settings.collapseTrigger + ' .' + this._settings.collapseIcon)

this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.collapseIcon)
.addClass(this._settings.expandIcon)
.removeClass(this._settings.collapseIcon)

Expand All @@ -85,7 +86,7 @@ const CardWidget = (($) => {
this._parent.removeClass(ClassName.COLLAPSED)
})

this._parent.find(this._settings.collapseTrigger + ' .' + this._settings.expandIcon)
this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.expandIcon)
.addClass(this._settings.collapseIcon)
.removeClass(this._settings.expandIcon)

Expand Down
23 changes: 12 additions & 11 deletions AdminLTE-3.x/build/js/ControlSidebar.js
Expand Up @@ -69,7 +69,7 @@ const ControlSidebar = (($) => {

// Public

show() {
collapse() {
// Show the control sidebar
if (this._config.controlsidebarSlide) {
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
Expand All @@ -82,11 +82,11 @@ const ControlSidebar = (($) => {
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
}

const expandedEvent = $.Event(Event.EXPANDED)
$(this._element).trigger(expandedEvent)
const collapsedEvent = $.Event(Event.COLLAPSED)
$(this._element).trigger(collapsedEvent)
}

collapse() {
show() {
// Collapse the control sidebar
if (this._config.controlsidebarSlide) {
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
Expand All @@ -101,19 +101,19 @@ const ControlSidebar = (($) => {
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
}

const collapsedEvent = $.Event(Event.COLLAPSED)
$(this._element).trigger(collapsedEvent)
const expandedEvent = $.Event(Event.EXPANDED)
$(this._element).trigger(expandedEvent)
}

toggle() {
const shouldOpen = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body')
const shouldClose = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body')
.hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)
if (shouldOpen) {
// Open the control sidebar
this.show()
} else {
if (shouldClose) {
// Close the control sidebar
this.collapse()
} else {
// Open the control sidebar
this.show()
}
}

Expand Down Expand Up @@ -289,3 +289,4 @@ const ControlSidebar = (($) => {
})(jQuery)

export default ControlSidebar

31 changes: 26 additions & 5 deletions AdminLTE-3.x/build/js/Layout.js
Expand Up @@ -29,6 +29,8 @@ const Layout = (($) => {
CONTENT_HEADER : '.content-header',
WRAPPER : '.wrapper',
CONTROL_SIDEBAR: '.control-sidebar',
CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
CONTROL_SIDEBAR_BTN: '[data-widget="control-sidebar"]',
LAYOUT_FIXED : '.layout-fixed',
FOOTER : '.main-footer',
PUSHMENU_BTN : '[data-widget="pushmenu"]',
Expand All @@ -46,6 +48,8 @@ const Layout = (($) => {
FOOTER_FIXED : 'layout-footer-fixed',
LOGIN_PAGE : 'login-page',
REGISTER_PAGE : 'register-page',
CONTROL_SIDEBAR_SLIDE_OPEN: 'control-sidebar-slide-open',
CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
}

const Default = {
Expand All @@ -68,17 +72,26 @@ const Layout = (($) => {

// Public

fixLayoutHeight() {
fixLayoutHeight(extra = null) {
let control_sidebar = 0

if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || extra == 'control_sidebar') {
control_sidebar = $(Selector.CONTROL_SIDEBAR_CONTENT).height()
}

const heights = {
window: $(window).height(),
header: $(Selector.HEADER).length !== 0 ? $(Selector.HEADER).outerHeight() : 0,
footer: $(Selector.FOOTER).length !== 0 ? $(Selector.FOOTER).outerHeight() : 0,
sidebar: $(Selector.SIDEBAR).length !== 0 ? $(Selector.SIDEBAR).height() : 0,
control_sidebar: control_sidebar,
}

const max = this._max(heights)

if (max == heights.window) {
if (max == heights.control_sidebar) {
$(Selector.CONTENT).css('min-height', max)
} else if (max == heights.window) {
$(Selector.CONTENT).css('min-height', max - heights.header - heights.footer)
} else {
$(Selector.CONTENT).css('min-height', max - heights.header)
Expand Down Expand Up @@ -115,6 +128,14 @@ const Layout = (($) => {
this.fixLayoutHeight()
})

$(Selector.CONTROL_SIDEBAR_BTN)
.on('collapsed.lte.controlsidebar', () => {
this.fixLayoutHeight()
})
.on('expanded.lte.controlsidebar', () => {
this.fixLayoutHeight('control_sidebar')
})

$(window).resize(() => {
this.fixLayoutHeight()
})
Expand Down Expand Up @@ -145,7 +166,7 @@ const Layout = (($) => {

// Static

static _jQueryInterface(config) {
static _jQueryInterface(config = '') {
return this.each(function () {
let data = $(this).data(DATA_KEY)
const _options = $.extend({}, Default, $(this).data())
Expand All @@ -155,8 +176,8 @@ const Layout = (($) => {
$(this).data(DATA_KEY, data)
}

if (config === 'init') {
data[config]()
if (config === 'init' || config === '') {
data['_init']()
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/AdminLTE-components.scss
@@ -1,5 +1,5 @@
/*!
* AdminLTE v3.0.1
* AdminLTE v3.0.2
* Only Components
* Author: Colorlib
* Website: AdminLTE.io <http://adminlte.io>
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/AdminLTE-core.scss
@@ -1,5 +1,5 @@
/*!
* AdminLTE v3.0.1
* AdminLTE v3.0.2
* Only Core
* Author: Colorlib
* Website: AdminLTE.io <http://adminlte.io>
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/AdminLTE-extra-components.scss
@@ -1,5 +1,5 @@
/*!
* AdminLTE v3.0.1
* AdminLTE v3.0.2
* Only Extra Components
* Author: Colorlib
* Website: AdminLTE.io <http://adminlte.io>
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/AdminLTE-pages.scss
@@ -1,5 +1,5 @@
/*!
* AdminLTE v3.0.1
* AdminLTE v3.0.2
* Only Pages
* Author: Colorlib
* Website: AdminLTE.io <http://adminlte.io>
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/AdminLTE-plugins.scss
@@ -1,5 +1,5 @@
/*!
* AdminLTE v3.0.1
* AdminLTE v3.0.2
* Only Plugins
* Author: Colorlib
* Website: AdminLTE.io <http://adminlte.io>
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/AdminLTE-raw.scss
@@ -1,5 +1,5 @@
/*!
* AdminLTE v3.0.1
* AdminLTE v3.0.2
* Author: Colorlib
* Website: AdminLTE.io <http://adminlte.io>
* License: Open source - MIT <http://opensource.org/licenses/MIT>
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/AdminLTE.scss
@@ -1,5 +1,5 @@
/*!
* AdminLTE v3.0.1
* AdminLTE v3.0.2
* Author: Colorlib
* Website: AdminLTE.io <http://adminlte.io>
* License: Open source - MIT <http://opensource.org/licenses/MIT>
Expand Down
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/_bootstrap-variables.scss
Expand Up @@ -447,7 +447,7 @@ $input-group-addon-color: $input-color !default;
$input-group-addon-bg: $gray-200 !default;
$input-group-addon-border-color: $input-border-color !default;

$custom-control-gutter: 1.5rem !default;
$custom-control-gutter: .5rem !default;
$custom-control-spacer-x: 1rem !default;

$custom-control-indicator-size: 1rem !default;
Expand Down
23 changes: 11 additions & 12 deletions AdminLTE-3.x/build/scss/_cards.scss
Expand Up @@ -2,6 +2,15 @@
// Component: Cards
//

// Color variants
@each $name, $color in $theme-colors {
@include cards-variant($name, $color);
}

@each $name, $color in $colors {
@include cards-variant($name, $color);
}

.card {
@include box-shadow($card-shadow);
margin-bottom: map-get($spacers, 3);
Expand Down Expand Up @@ -78,7 +87,7 @@

&.card-tabs {
&:not(.card-outline) {
& .card-header {
& > .card-header {
border-bottom: 0;

.nav-item {
Expand Down Expand Up @@ -211,7 +220,7 @@ html.maximized-card {
}

.nav-link {
padding: $card-nav-link-padding-sm-y $card-nav-link-padding-sm-x;
padding: $card-nav-link-padding-sm-y $card-nav-link-padding-sm-x;
}
}

Expand Down Expand Up @@ -401,16 +410,6 @@ html.maximized-card {
max-width: 200px;
}

// Color variants
@each $name, $color in $theme-colors {
@include cards-variant($name, $color);
}

@each $name, $color in $colors {
@include cards-variant($name, $color);
}


// Nav Tabs override
.card-default {
.nav-item {
Expand Down
9 changes: 9 additions & 0 deletions AdminLTE-3.x/build/scss/_colors.scss
Expand Up @@ -80,3 +80,12 @@ a.text-muted:hover {
@each $name, $color in $colors {
@include accent-variant($name, $color);
}

// Accent button override fix
[class*="accent-"] {
@each $name, $color in $theme-colors {
a.btn-#{$name} {
color: color-yiq($color);
}
}
}
2 changes: 1 addition & 1 deletion AdminLTE-3.x/build/scss/_forms.scss
Expand Up @@ -96,7 +96,7 @@
}
}

label:not(.form-check-label, .custom-file-label) {
label:not(.form-check-label):not(.custom-file-label) {
font-weight: $font-weight-bold;
}

Expand Down
59 changes: 50 additions & 9 deletions AdminLTE-3.x/build/scss/_layout.scss
Expand Up @@ -78,6 +78,26 @@ body,
}
}

body:not(.layout-fixed).layout-navbar-fixed & {
.main-sidebar {
margin-top: calc(#{$main-header-height} / -1);

.sidebar {
margin-top: $main-header-height;
}
}
}

body:not(.layout-fixed).layout-navbar-fixed.text-sm & {
.main-sidebar {
margin-top: calc(#{$main-header-height-sm} / -1);

.sidebar {
margin-top: $main-header-height-sm;
}
}
}

.layout-navbar-fixed & {
.control-sidebar {
top: 0;
Expand Down Expand Up @@ -269,6 +289,26 @@ body,
}
}

body:not(.layout-fixed).layout#{$infix}-navbar-fixed & {
.main-sidebar {
margin-top: calc(#{$main-header-height} / -1);

.sidebar {
margin-top: $main-header-height;
}
}
}

body:not(.layout-fixed).layout#{$infix}-navbar-fixed.text-sm & {
.main-sidebar {
margin-top: calc(#{$main-header-height-sm} / -1);

.sidebar {
margin-top: $main-header-height-sm;
}
}
}

.layout#{$infix}-navbar-not-fixed & {
.brand-link {
position: static;
Expand Down Expand Up @@ -352,9 +392,11 @@ body,
.layout-top-nav & {
margin-left: 0;

& .text-sm {
.main-header {
.brand-image {
margin-top: -.5rem;
margin-right: .2rem;
height: 33px;
}
}

Expand All @@ -363,14 +405,6 @@ body,
height: inherit;
}

.brand-image {
height: 33px;
}

& .main-sidebar {
display: none;
}

& .content-wrapper,
& .main-header,
& .main-footer {
Expand Down Expand Up @@ -453,6 +487,13 @@ body:not(.sidebar-mini-md) {
width: $sidebar-width;
}

.sidebar-collapse:not(.sidebar-mini):not(.sidebar-mini-md) & {
&,
&::before {
box-shadow: none !important;
}
}

.sidebar-collapse & {
&,
&::before {
Expand Down

0 comments on commit c5e5631

Please sign in to comment.