|
|
|
@ -11,8 +11,6 @@
|
|
|
|
|
* @license MIT <http://opensource.org/licenses/MIT>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
//Make sure jQuery has been loaded before app.js
|
|
|
|
|
if (typeof jQuery === "undefined") {
|
|
|
|
|
throw new Error("AdminLTE requires jQuery");
|
|
|
|
@ -140,6 +138,8 @@ $.AdminLTE.options = {
|
|
|
|
|
* options above.
|
|
|
|
|
*/
|
|
|
|
|
$(function () {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
//Extend options if external options exist
|
|
|
|
|
if (typeof AdminLTEOptions !== "undefined") {
|
|
|
|
|
$.extend(true,
|
|
|
|
@ -224,7 +224,7 @@ $(function () {
|
|
|
|
|
* All AdminLTE functions are implemented below.
|
|
|
|
|
*/
|
|
|
|
|
function _init() {
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
/* Layout
|
|
|
|
|
* ======
|
|
|
|
|
* Fixes the layout height in case min-height fails.
|
|
|
|
@ -279,8 +279,8 @@ function _init() {
|
|
|
|
|
$(".sidebar").slimScroll({destroy: true}).height("auto");
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
} else if (typeof $.fn.slimScroll == 'undefined' && console) {
|
|
|
|
|
console.error("Error: the fixed layout requires the slimscroll plugin!");
|
|
|
|
|
} else if (typeof $.fn.slimScroll == 'undefined' && window.console) {
|
|
|
|
|
window.console.error("Error: the fixed layout requires the slimscroll plugin!");
|
|
|
|
|
}
|
|
|
|
|
//Enable slimscroll for fixed layout
|
|
|
|
|
if ($.AdminLTE.options.sidebarSlimScroll) {
|
|
|
|
@ -476,7 +476,6 @@ function _init() {
|
|
|
|
|
},
|
|
|
|
|
//Open the control sidebar
|
|
|
|
|
open: function (sidebar, slide) {
|
|
|
|
|
var _this = this;
|
|
|
|
|
//Slide over content
|
|
|
|
|
if (slide) {
|
|
|
|
|
sidebar.addClass('control-sidebar-open');
|
|
|
|
@ -603,6 +602,8 @@ function _init() {
|
|
|
|
|
*/
|
|
|
|
|
(function ($) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
$.fn.boxRefresh = function (options) {
|
|
|
|
|
|
|
|
|
|
// Render options
|
|
|
|
@ -613,8 +614,10 @@ function _init() {
|
|
|
|
|
source: "",
|
|
|
|
|
//Callbacks
|
|
|
|
|
onLoadStart: function (box) {
|
|
|
|
|
return box;
|
|
|
|
|
}, //Right after the button has been clicked
|
|
|
|
|
onLoadDone: function (box) {
|
|
|
|
|
return box;
|
|
|
|
|
} //When the source has been loaded
|
|
|
|
|
|
|
|
|
|
}, options);
|
|
|
|
@ -625,8 +628,8 @@ function _init() {
|
|
|
|
|
return this.each(function () {
|
|
|
|
|
//if a source is specified
|
|
|
|
|
if (settings.source === "") {
|
|
|
|
|
if (console) {
|
|
|
|
|
console.log("Please specify a source first - boxRefresh()");
|
|
|
|
|
if (window.console) {
|
|
|
|
|
window.console.log("Please specify a source first - boxRefresh()");
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -677,6 +680,8 @@ function _init() {
|
|
|
|
|
*/
|
|
|
|
|
(function ($) {
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
$.fn.activateBox = function () {
|
|
|
|
|
$.AdminLTE.boxWidget.activate(this);
|
|
|
|
|
};
|
|
|
|
@ -693,36 +698,44 @@ function _init() {
|
|
|
|
|
*/
|
|
|
|
|
(function ($) {
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
$.fn.todolist = function (options) {
|
|
|
|
|
// Render options
|
|
|
|
|
var settings = $.extend({
|
|
|
|
|
//When the user checks the input
|
|
|
|
|
onCheck: function (ele) {
|
|
|
|
|
return ele;
|
|
|
|
|
},
|
|
|
|
|
//When the user unchecks the input
|
|
|
|
|
onUncheck: function (ele) {
|
|
|
|
|
return ele;
|
|
|
|
|
}
|
|
|
|
|
}, options);
|
|
|
|
|
|
|
|
|
|
return this.each(function () {
|
|
|
|
|
|
|
|
|
|
if (typeof $.fn.iCheck != 'undefined') {
|
|
|
|
|
$('input', this).on('ifChecked', function (event) {
|
|
|
|
|
$('input', this).on('ifChecked', function () {
|
|
|
|
|
var ele = $(this).parents("li").first();
|
|
|
|
|
ele.toggleClass("done");
|
|
|
|
|
settings.onCheck.call(ele);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('input', this).on('ifUnchecked', function (event) {
|
|
|
|
|
$('input', this).on('ifUnchecked', function () {
|
|
|
|
|
var ele = $(this).parents("li").first();
|
|
|
|
|
ele.toggleClass("done");
|
|
|
|
|
settings.onUncheck.call(ele);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
$('input', this).on('change', function (event) {
|
|
|
|
|
$('input', this).on('change', function () {
|
|
|
|
|
var ele = $(this).parents("li").first();
|
|
|
|
|
ele.toggleClass("done");
|
|
|
|
|
if ($('input', ele).is(":checked")) {
|
|
|
|
|
settings.onCheck.call(ele);
|
|
|
|
|
} else {
|
|
|
|
|
settings.onUncheck.call(ele);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|