some small js option fixes
This commit is contained in:
@@ -118,10 +118,10 @@ const CardRefresh = (($) => {
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
let options = $(this).data()
|
||||
const _options = $.extend({}, Default, $(this).data())
|
||||
|
||||
if (!data) {
|
||||
data = new CardRefresh($(this), options)
|
||||
data = new CardRefresh($(this), _options)
|
||||
$(this).data(DATA_KEY, typeof config === 'string' ? data: config)
|
||||
}
|
||||
|
||||
|
||||
@@ -188,9 +188,10 @@ const CardWidget = (($) => {
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _options = $.extend({}, Default, $(this).data())
|
||||
|
||||
if (!data) {
|
||||
data = new CardWidget($(this), data)
|
||||
data = new CardWidget($(this), _options)
|
||||
$(this).data(DATA_KEY, typeof config === 'string' ? data: config)
|
||||
}
|
||||
|
||||
|
||||
@@ -246,9 +246,10 @@ const ControlSidebar = (($) => {
|
||||
static _jQueryInterface(operation) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _options = $.extend({}, Default, $(this).data())
|
||||
|
||||
if (!data) {
|
||||
data = new ControlSidebar(this, $(this).data())
|
||||
data = new ControlSidebar(this, _options)
|
||||
$(this).data(DATA_KEY, data)
|
||||
}
|
||||
|
||||
|
||||
@@ -147,11 +147,11 @@ const Layout = (($) => {
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _config = $.extend({}, Default, $(this).data())
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _options = $.extend({}, Default, $(this).data())
|
||||
|
||||
if (!data) {
|
||||
data = new Layout($(this), _config)
|
||||
data = new Layout($(this), _options)
|
||||
$(this).data(DATA_KEY, data)
|
||||
}
|
||||
|
||||
|
||||
@@ -201,8 +201,8 @@ const Toasts = (($) => {
|
||||
|
||||
static _jQueryInterface(option, config) {
|
||||
return this.each(function () {
|
||||
const _config = $.extend({}, Default, config)
|
||||
var toast = new Toasts($(this), _config)
|
||||
const _options = $.extend({}, Default, config)
|
||||
var toast = new Toasts($(this), _options)
|
||||
|
||||
if (option === 'create') {
|
||||
toast[option]()
|
||||
|
||||
@@ -80,11 +80,11 @@ const TodoList = (($) => {
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _config = $.extend({}, Default, $(this).data())
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _options = $.extend({}, Default, $(this).data())
|
||||
|
||||
if (!data) {
|
||||
data = new TodoList($(this), _config)
|
||||
data = new TodoList($(this), _options)
|
||||
$(this).data(DATA_KEY, data)
|
||||
}
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ const Treeview = (($) => {
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _config = $.extend({}, Default, $(this).data())
|
||||
let data = $(this).data(DATA_KEY)
|
||||
const _options = $.extend({}, Default, $(this).data())
|
||||
|
||||
if (!data) {
|
||||
data = new Treeview($(this), _config)
|
||||
data = new Treeview($(this), _options)
|
||||
$(this).data(DATA_KEY, data)
|
||||
}
|
||||
|
||||
|
||||
34
dist/js/adminlte.js
vendored
34
dist/js/adminlte.js
vendored
@@ -52,6 +52,11 @@
|
||||
FOOTER_LG_FIXED: 'layout-lg-footer-fixed',
|
||||
FOOTER_XL_FIXED: 'layout-xl-footer-fixed'
|
||||
};
|
||||
var Default = {
|
||||
controlsidebarSlide: true,
|
||||
scrollbarTheme: 'os-theme-light',
|
||||
scrollbarAutoHide: 'l'
|
||||
};
|
||||
/**
|
||||
* Class Definition
|
||||
* ====================================================
|
||||
@@ -230,8 +235,10 @@
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
|
||||
var _options = $.extend({}, Default, $(this).data());
|
||||
|
||||
if (!data) {
|
||||
data = new ControlSidebar(this, $(this).data());
|
||||
data = new ControlSidebar(this, _options);
|
||||
$(this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
@@ -409,10 +416,10 @@
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
|
||||
var _config = $.extend({}, Default, $(this).data());
|
||||
var _options = $.extend({}, Default, $(this).data());
|
||||
|
||||
if (!data) {
|
||||
data = new Layout($(this), _config);
|
||||
data = new Layout($(this), _options);
|
||||
$(this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
@@ -819,10 +826,10 @@
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
|
||||
var _config = $.extend({}, Default, $(this).data());
|
||||
var _options = $.extend({}, Default, $(this).data());
|
||||
|
||||
if (!data) {
|
||||
data = new Treeview($(this), _config);
|
||||
data = new Treeview($(this), _options);
|
||||
$(this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
@@ -1028,10 +1035,10 @@
|
||||
return this.each(function () {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
|
||||
var _config = $.extend({}, Default, $(this).data());
|
||||
var _options = $.extend({}, Default, $(this).data());
|
||||
|
||||
if (!data) {
|
||||
data = new TodoList($(this), _config);
|
||||
data = new TodoList($(this), _options);
|
||||
$(this).data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
@@ -1253,8 +1260,10 @@
|
||||
CardWidget._jQueryInterface = function _jQueryInterface(config) {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
|
||||
var _options = $.extend({}, Default, $(this).data());
|
||||
|
||||
if (!data) {
|
||||
data = new CardWidget($(this), data);
|
||||
data = new CardWidget($(this), _options);
|
||||
$(this).data(DATA_KEY, typeof config === 'string' ? data : config);
|
||||
}
|
||||
|
||||
@@ -1427,10 +1436,11 @@
|
||||
|
||||
CardRefresh._jQueryInterface = function _jQueryInterface(config) {
|
||||
var data = $(this).data(DATA_KEY);
|
||||
var options = $(this).data();
|
||||
|
||||
var _options = $.extend({}, Default, $(this).data());
|
||||
|
||||
if (!data) {
|
||||
data = new CardRefresh($(this), options);
|
||||
data = new CardRefresh($(this), _options);
|
||||
$(this).data(DATA_KEY, typeof config === 'string' ? data : config);
|
||||
}
|
||||
|
||||
@@ -1757,9 +1767,9 @@
|
||||
|
||||
Toasts._jQueryInterface = function _jQueryInterface(option, config) {
|
||||
return this.each(function () {
|
||||
var _config = $.extend({}, Default, config);
|
||||
var _options = $.extend({}, Default, config);
|
||||
|
||||
var toast = new Toasts($(this), _config);
|
||||
var toast = new Toasts($(this), _options);
|
||||
|
||||
if (option === 'create') {
|
||||
toast[option]();
|
||||
|
||||
2
dist/js/adminlte.js.map
vendored
2
dist/js/adminlte.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/js/adminlte.min.js
vendored
2
dist/js/adminlte.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/adminlte.min.js.map
vendored
2
dist/js/adminlte.min.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user