mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Update AdminLTE
- from 2.4.5 to 2.4.18 (cannot detect any issues) - set default scancycle for Apple Devices to 1
This commit is contained in:
436
front/lib/AdminLTE/dist/js/adminlte.js
vendored
436
front/lib/AdminLTE/dist/js/adminlte.js
vendored
@@ -4,11 +4,10 @@
|
||||
* should be included in all pages. It controls some layout
|
||||
* options and implements exclusive AdminLTE plugins.
|
||||
*
|
||||
* @Author Almsaeed Studio
|
||||
* @Support <https://www.almsaeedstudio.com>
|
||||
* @Email <abdullah@almsaeedstudio.com>
|
||||
* @version 2.4.5
|
||||
* @repository git://github.com/almasaeed2010/AdminLTE.git
|
||||
* @author Colorlib
|
||||
* @support <https://github.com/ColorlibHQ/AdminLTE/issues>
|
||||
* @version v2.4.18
|
||||
* @repository git://github.com/ColorlibHQ/AdminLTE.git
|
||||
* @license MIT <http://opensource.org/licenses/MIT>
|
||||
*/
|
||||
|
||||
@@ -54,7 +53,7 @@ throw new Error('AdminLTE requires jQuery')
|
||||
var BoxRefresh = function (element, options) {
|
||||
this.element = element;
|
||||
this.options = options;
|
||||
this.$overlay = $(options.overlay);
|
||||
this.$overlay = $(options.overlayTemplate);
|
||||
|
||||
if (options.source === '') {
|
||||
throw new Error('Source url was not defined. Please specify a url in your BoxRefresh source option.');
|
||||
@@ -70,7 +69,7 @@ throw new Error('AdminLTE requires jQuery')
|
||||
|
||||
$.get(this.options.source, this.options.params, function (response) {
|
||||
if (this.options.loadInContent) {
|
||||
$(this.options.content).html(response);
|
||||
$(this.element).find(this.options.content).html(response);
|
||||
}
|
||||
this.options.onLoadDone.call($(this), response);
|
||||
this._removeOverlay();
|
||||
@@ -80,7 +79,7 @@ throw new Error('AdminLTE requires jQuery')
|
||||
// Private
|
||||
|
||||
BoxRefresh.prototype._setUpListeners = function () {
|
||||
$(this.element).on('click', Selector.trigger, function (event) {
|
||||
$(this.element).on('click', this.options.trigger, function (event) {
|
||||
if (event) event.preventDefault();
|
||||
this.load();
|
||||
}.bind(this));
|
||||
@@ -91,7 +90,7 @@ throw new Error('AdminLTE requires jQuery')
|
||||
};
|
||||
|
||||
BoxRefresh.prototype._removeOverlay = function () {
|
||||
$(this.element).remove(this.$overlay);
|
||||
$(this.$overlay).remove();
|
||||
};
|
||||
|
||||
// Plugin Definition
|
||||
@@ -174,10 +173,13 @@ throw new Error('AdminLTE requires jQuery')
|
||||
};
|
||||
|
||||
var Event = {
|
||||
collapsed: 'collapsed.boxwidget',
|
||||
expanded : 'expanded.boxwidget',
|
||||
removed : 'removed.boxwidget'
|
||||
};
|
||||
collapsing: 'collapsing.boxwidget',
|
||||
collapsed: 'collapsed.boxwidget',
|
||||
expanding: 'expanding.boxwidget',
|
||||
expanded: 'expanded.boxwidget',
|
||||
removing: 'removing.boxwidget',
|
||||
removed: 'removed.boxwidget'
|
||||
};
|
||||
|
||||
// BoxWidget Class Definition
|
||||
// =====================
|
||||
@@ -200,6 +202,7 @@ throw new Error('AdminLTE requires jQuery')
|
||||
|
||||
BoxWidget.prototype.expand = function () {
|
||||
var expandedEvent = $.Event(Event.expanded);
|
||||
var expandingEvent = $.Event(Event.expanding);
|
||||
var collapseIcon = this.options.collapseIcon;
|
||||
var expandIcon = this.options.expandIcon;
|
||||
|
||||
@@ -215,11 +218,13 @@ throw new Error('AdminLTE requires jQuery')
|
||||
$(this.element).children(Selector.body + ', ' + Selector.footer)
|
||||
.slideDown(this.options.animationSpeed, function () {
|
||||
$(this.element).trigger(expandedEvent);
|
||||
}.bind(this));
|
||||
}.bind(this))
|
||||
.trigger(expandingEvent);
|
||||
};
|
||||
|
||||
BoxWidget.prototype.collapse = function () {
|
||||
var collapsedEvent = $.Event(Event.collapsed);
|
||||
var collapsingEvent = $.Event(Event.collapsing);
|
||||
var collapseIcon = this.options.collapseIcon;
|
||||
var expandIcon = this.options.expandIcon;
|
||||
|
||||
@@ -234,16 +239,19 @@ throw new Error('AdminLTE requires jQuery')
|
||||
.slideUp(this.options.animationSpeed, function () {
|
||||
$(this.element).addClass(ClassName.collapsed);
|
||||
$(this.element).trigger(collapsedEvent);
|
||||
}.bind(this));
|
||||
}.bind(this))
|
||||
.trigger(collapsingEvent);
|
||||
};
|
||||
|
||||
BoxWidget.prototype.remove = function () {
|
||||
var removedEvent = $.Event(Event.removed);
|
||||
var removingEvent = $.Event(Event.removing);
|
||||
|
||||
$(this.element).slideUp(this.options.animationSpeed, function () {
|
||||
$(this.element).trigger(removedEvent);
|
||||
$(this.element).remove();
|
||||
}.bind(this));
|
||||
}.bind(this))
|
||||
.trigger(removingEvent);
|
||||
};
|
||||
|
||||
// Private
|
||||
@@ -321,7 +329,7 @@ throw new Error('AdminLTE requires jQuery')
|
||||
var DataKey = 'lte.controlsidebar';
|
||||
|
||||
var Default = {
|
||||
slide: true
|
||||
controlsidebarSlide: true
|
||||
};
|
||||
|
||||
var Selector = {
|
||||
@@ -335,7 +343,8 @@ throw new Error('AdminLTE requires jQuery')
|
||||
};
|
||||
|
||||
var ClassName = {
|
||||
open : 'control-sidebar-open',
|
||||
open: 'control-sidebar-open',
|
||||
transition: 'control-sidebar-hold-transition',
|
||||
fixed: 'fixed'
|
||||
};
|
||||
|
||||
@@ -380,17 +389,30 @@ throw new Error('AdminLTE requires jQuery')
|
||||
};
|
||||
|
||||
ControlSidebar.prototype.expand = function () {
|
||||
if (!this.options.slide) {
|
||||
$('body').addClass(ClassName.open);
|
||||
$(Selector.sidebar).show();
|
||||
if (!this.options.controlsidebarSlide) {
|
||||
$('body').addClass(ClassName.transition).addClass(ClassName.open).delay(50).queue(function(){
|
||||
$('body').removeClass(ClassName.transition);
|
||||
$(this).dequeue()
|
||||
})
|
||||
} else {
|
||||
$(Selector.sidebar).addClass(ClassName.open);
|
||||
}
|
||||
|
||||
|
||||
$(this.element).trigger($.Event(Event.expanded));
|
||||
};
|
||||
|
||||
ControlSidebar.prototype.collapse = function () {
|
||||
$('body, ' + Selector.sidebar).removeClass(ClassName.open);
|
||||
if (!this.options.controlsidebarSlide) {
|
||||
$('body').addClass(ClassName.transition).removeClass(ClassName.open).delay(50).queue(function(){
|
||||
$('body').removeClass(ClassName.transition);
|
||||
$(this).dequeue()
|
||||
})
|
||||
} else {
|
||||
$(Selector.sidebar).removeClass(ClassName.open);
|
||||
}
|
||||
$(Selector.sidebar).fadeOut();
|
||||
$(this.element).trigger($.Event(Event.collapsed));
|
||||
};
|
||||
|
||||
@@ -515,186 +537,6 @@ throw new Error('AdminLTE requires jQuery')
|
||||
}(jQuery);
|
||||
|
||||
|
||||
/* Layout()
|
||||
* ========
|
||||
* Implements AdminLTE layout.
|
||||
* Fixes the layout height in case min-height fails.
|
||||
*
|
||||
* @usage activated automatically upon window load.
|
||||
* Configure any options by passing data-option="value"
|
||||
* to the body tag.
|
||||
*/
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
var DataKey = 'lte.layout';
|
||||
|
||||
var Default = {
|
||||
slimscroll : true,
|
||||
resetHeight: true
|
||||
};
|
||||
|
||||
var Selector = {
|
||||
wrapper : '.wrapper',
|
||||
contentWrapper: '.content-wrapper',
|
||||
layoutBoxed : '.layout-boxed',
|
||||
mainFooter : '.main-footer',
|
||||
mainHeader : '.main-header',
|
||||
sidebar : '.sidebar',
|
||||
controlSidebar: '.control-sidebar',
|
||||
fixed : '.fixed',
|
||||
sidebarMenu : '.sidebar-menu',
|
||||
logo : '.main-header .logo'
|
||||
};
|
||||
|
||||
var ClassName = {
|
||||
fixed : 'fixed',
|
||||
holdTransition: 'hold-transition'
|
||||
};
|
||||
|
||||
var Layout = function (options) {
|
||||
this.options = options;
|
||||
this.bindedResize = false;
|
||||
this.activate();
|
||||
};
|
||||
|
||||
Layout.prototype.activate = function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
|
||||
$('body').removeClass(ClassName.holdTransition);
|
||||
|
||||
if (this.options.resetHeight) {
|
||||
$('body, html, ' + Selector.wrapper).css({
|
||||
'height' : 'auto',
|
||||
'min-height': '100%'
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.bindedResize) {
|
||||
$(window).resize(function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
|
||||
$(Selector.logo + ', ' + Selector.sidebar).one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
|
||||
this.bindedResize = true;
|
||||
}
|
||||
|
||||
$(Selector.sidebarMenu).on('expanded.tree', function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
}.bind(this));
|
||||
|
||||
$(Selector.sidebarMenu).on('collapsed.tree', function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
Layout.prototype.fix = function () {
|
||||
// Remove overflow from .wrapper if layout-boxed exists
|
||||
$(Selector.layoutBoxed + ' > ' + Selector.wrapper).css('overflow', 'hidden');
|
||||
|
||||
// Get window height and the wrapper height
|
||||
var footerHeight = $(Selector.mainFooter).outerHeight() || 0;
|
||||
var headerHeight = $(Selector.mainHeader).outerHeight() || 0;
|
||||
var neg = headerHeight + footerHeight;
|
||||
var windowHeight = $(window).height();
|
||||
var sidebarHeight = $(Selector.sidebar).height() || 0;
|
||||
|
||||
// Set the min-height of the content and sidebar based on
|
||||
// the height of the document.
|
||||
if ($('body').hasClass(ClassName.fixed)) {
|
||||
$(Selector.contentWrapper).css('min-height', windowHeight - footerHeight);
|
||||
} else {
|
||||
var postSetHeight;
|
||||
|
||||
if (windowHeight >= sidebarHeight) {
|
||||
$(Selector.contentWrapper).css('min-height', windowHeight - neg);
|
||||
postSetHeight = windowHeight - neg;
|
||||
} else {
|
||||
$(Selector.contentWrapper).css('min-height', sidebarHeight);
|
||||
postSetHeight = sidebarHeight;
|
||||
}
|
||||
|
||||
// Fix for the control sidebar height
|
||||
var $controlSidebar = $(Selector.controlSidebar);
|
||||
if (typeof $controlSidebar !== 'undefined') {
|
||||
if ($controlSidebar.height() > postSetHeight)
|
||||
$(Selector.contentWrapper).css('min-height', $controlSidebar.height());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Layout.prototype.fixSidebar = function () {
|
||||
// Make sure the body tag has the .fixed class
|
||||
if (!$('body').hasClass(ClassName.fixed)) {
|
||||
if (typeof $.fn.slimScroll !== 'undefined') {
|
||||
$(Selector.sidebar).slimScroll({ destroy: true }).height('auto');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Enable slimscroll for fixed layout
|
||||
if (this.options.slimscroll) {
|
||||
if (typeof $.fn.slimScroll !== 'undefined') {
|
||||
// Destroy if it exists
|
||||
// $(Selector.sidebar).slimScroll({ destroy: true }).height('auto')
|
||||
|
||||
// Add slimscroll
|
||||
$(Selector.sidebar).slimScroll({
|
||||
height: ($(window).height() - $(Selector.mainHeader).height()) + 'px'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Plugin Definition
|
||||
// =================
|
||||
function Plugin(option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data(DataKey);
|
||||
|
||||
if (!data) {
|
||||
var options = $.extend({}, Default, $this.data(), typeof option === 'object' && option);
|
||||
$this.data(DataKey, (data = new Layout(options)));
|
||||
}
|
||||
|
||||
if (typeof option === 'string') {
|
||||
if (typeof data[option] === 'undefined') {
|
||||
throw new Error('No method named ' + option);
|
||||
}
|
||||
data[option]();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var old = $.fn.layout;
|
||||
|
||||
$.fn.layout = Plugin;
|
||||
$.fn.layout.Constuctor = Layout;
|
||||
|
||||
// No conflict mode
|
||||
// ================
|
||||
$.fn.layout.noConflict = function () {
|
||||
$.fn.layout = old;
|
||||
return this;
|
||||
};
|
||||
|
||||
// Layout DATA-API
|
||||
// ===============
|
||||
$(window).on('load', function () {
|
||||
Plugin.call($('body'));
|
||||
});
|
||||
}(jQuery);
|
||||
|
||||
|
||||
/* PushMenu()
|
||||
* ==========
|
||||
* Adds the push menu functionality to the sidebar.
|
||||
@@ -1067,8 +909,9 @@ throw new Error('AdminLTE requires jQuery')
|
||||
}
|
||||
|
||||
parent.addClass(ClassName.open);
|
||||
tree.slideDown(this.options.animationSpeed, function () {
|
||||
tree.stop().slideDown(this.options.animationSpeed, function () {
|
||||
$(this.element).trigger(expandedEvent);
|
||||
parent.height('auto');
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
@@ -1077,9 +920,12 @@ throw new Error('AdminLTE requires jQuery')
|
||||
|
||||
//tree.find(Selector.open).removeClass(ClassName.open);
|
||||
parentLi.removeClass(ClassName.open);
|
||||
tree.slideUp(this.options.animationSpeed, function () {
|
||||
tree.stop().slideUp(this.options.animationSpeed, function () {
|
||||
//tree.find(Selector.open + ' > ' + Selector.treeview).slideUp();
|
||||
$(this.element).trigger(collapsedEvent);
|
||||
|
||||
// Collapse child items
|
||||
parentLi.find(Selector.treeview).removeClass(ClassName.open).find(Selector.treeviewMenu).hide();
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
@@ -1128,3 +974,187 @@ throw new Error('AdminLTE requires jQuery')
|
||||
});
|
||||
|
||||
}(jQuery);
|
||||
|
||||
|
||||
/* Layout()
|
||||
* ========
|
||||
* Implements AdminLTE layout.
|
||||
* Fixes the layout height in case min-height fails.
|
||||
*
|
||||
* @usage activated automatically upon window load.
|
||||
* Configure any options by passing data-option="value"
|
||||
* to the body tag.
|
||||
*/
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
var DataKey = 'lte.layout';
|
||||
|
||||
var Default = {
|
||||
slimscroll : true,
|
||||
resetHeight: true
|
||||
};
|
||||
|
||||
var Selector = {
|
||||
wrapper : '.wrapper',
|
||||
contentWrapper: '.content-wrapper',
|
||||
layoutBoxed : '.layout-boxed',
|
||||
mainFooter : '.main-footer',
|
||||
mainHeader : '.main-header',
|
||||
mainSidebar : '.main-sidebar',
|
||||
slimScrollDiv : 'slimScrollDiv',
|
||||
sidebar : '.sidebar',
|
||||
controlSidebar: '.control-sidebar',
|
||||
fixed : '.fixed',
|
||||
sidebarMenu : '.sidebar-menu',
|
||||
logo : '.main-header .logo'
|
||||
};
|
||||
|
||||
var ClassName = {
|
||||
fixed : 'fixed',
|
||||
holdTransition: 'hold-transition'
|
||||
};
|
||||
|
||||
var Layout = function (options) {
|
||||
this.options = options;
|
||||
this.bindedResize = false;
|
||||
this.activate();
|
||||
};
|
||||
|
||||
Layout.prototype.activate = function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
|
||||
$('body').removeClass(ClassName.holdTransition);
|
||||
|
||||
if (this.options.resetHeight) {
|
||||
$('body, html, ' + Selector.wrapper).css({
|
||||
'height' : 'auto',
|
||||
'min-height': '100%'
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.bindedResize) {
|
||||
$(window).resize(function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
|
||||
$(Selector.logo + ', ' + Selector.sidebar).one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
|
||||
this.bindedResize = true;
|
||||
}
|
||||
|
||||
$(Selector.sidebarMenu).on('expanded.tree', function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
}.bind(this));
|
||||
|
||||
$(Selector.sidebarMenu).on('collapsed.tree', function () {
|
||||
this.fix();
|
||||
this.fixSidebar();
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
Layout.prototype.fix = function () {
|
||||
// Remove overflow from .wrapper if layout-boxed exists
|
||||
$(Selector.layoutBoxed + ' > ' + Selector.wrapper).css('overflow', 'hidden');
|
||||
|
||||
// Get window height and the wrapper height
|
||||
var footerHeight = $(Selector.mainFooter).outerHeight() || 0;
|
||||
var headerHeight = $(Selector.mainHeader).outerHeight() || 0;
|
||||
var neg = headerHeight + footerHeight;
|
||||
var windowHeight = $(window).height();
|
||||
var sidebarHeight = $(Selector.sidebar).outerHeight() || 0;
|
||||
|
||||
// Set the min-height of the content and sidebar based on
|
||||
// the height of the document.
|
||||
if ($('body').hasClass(ClassName.fixed)) {
|
||||
$(Selector.contentWrapper).css('min-height', windowHeight - footerHeight);
|
||||
} else {
|
||||
var postSetHeight;
|
||||
|
||||
if (windowHeight >= sidebarHeight + headerHeight) {
|
||||
$(Selector.contentWrapper).css('min-height', windowHeight - neg);
|
||||
postSetHeight = windowHeight - neg;
|
||||
} else {
|
||||
$(Selector.contentWrapper).css('min-height', sidebarHeight);
|
||||
postSetHeight = sidebarHeight;
|
||||
}
|
||||
|
||||
// Fix for the control sidebar height
|
||||
var $controlSidebar = $(Selector.controlSidebar);
|
||||
if (typeof $controlSidebar !== 'undefined') {
|
||||
if ($controlSidebar.height() > postSetHeight)
|
||||
$(Selector.contentWrapper).css('min-height', $controlSidebar.height());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Layout.prototype.fixSidebar = function () {
|
||||
// Make sure the body tag has the .fixed class
|
||||
if (!$('body').hasClass(ClassName.fixed)) {
|
||||
if (typeof $.fn.slimScroll !== 'undefined') {
|
||||
$(Selector.sidebar).slimScroll({ destroy: true }).height('auto');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Enable slimscroll for fixed layout
|
||||
if (this.options.slimscroll) {
|
||||
if (typeof $.fn.slimScroll !== 'undefined') {
|
||||
// Destroy if it exists
|
||||
// $(Selector.sidebar).slimScroll({ destroy: true }).height('auto')
|
||||
|
||||
// Add slimscroll
|
||||
if ($(Selector.mainSidebar).find(Selector.slimScrollDiv).length === 0) {
|
||||
$(Selector.sidebar).slimScroll({
|
||||
height: ($(window).height() - $(Selector.mainHeader).height()) + 'px'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Plugin Definition
|
||||
// =================
|
||||
function Plugin(option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data(DataKey);
|
||||
|
||||
if (!data) {
|
||||
var options = $.extend({}, Default, $this.data(), typeof option === 'object' && option);
|
||||
$this.data(DataKey, (data = new Layout(options)));
|
||||
}
|
||||
|
||||
if (typeof option === 'string') {
|
||||
if (typeof data[option] === 'undefined') {
|
||||
throw new Error('No method named ' + option);
|
||||
}
|
||||
data[option]();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var old = $.fn.layout;
|
||||
|
||||
$.fn.layout = Plugin;
|
||||
$.fn.layout.Constuctor = Layout;
|
||||
|
||||
// No conflict mode
|
||||
// ================
|
||||
$.fn.layout.noConflict = function () {
|
||||
$.fn.layout = old;
|
||||
return this;
|
||||
};
|
||||
|
||||
// Layout DATA-API
|
||||
// ===============
|
||||
$(window).on('load', function () {
|
||||
Plugin.call($('body'));
|
||||
});
|
||||
}(jQuery);
|
||||
|
||||
Reference in New Issue
Block a user