Skip to content

Commit 72629c5

Browse files
authored
Update app.js
1 parent 5bbcdbf commit 72629c5

File tree

1 file changed

+1
-170
lines changed

1 file changed

+1
-170
lines changed

app.js

+1-170
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ $(function () {
126126
var o = $.AdminLTE.options;
127127

128128
//Set up the object
129-
// _init();
129+
_init();
130130

131131
//Activate the layout maker
132132
$.AdminLTE.layout.activate();
@@ -141,15 +141,6 @@ $(function () {
141141
$.AdminLTE.controlSidebar.activate();
142142
}
143143

144-
//Add slimscroll to navbar dropdown
145-
if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') {
146-
$(".navbar .menu").slimscroll({
147-
height: o.navbarMenuHeight,
148-
alwaysVisible: false,
149-
size: o.navbarMenuSlimscrollWidth
150-
}).css("width", "100%");
151-
}
152-
153144
//Activate sidebar push menu
154145
if (o.sidebarPushMenu) {
155146
$.AdminLTE.pushMenu.activate(o.sidebarToggleSelector);
@@ -259,82 +250,6 @@ function _init() {
259250
}
260251
};
261252

262-
/* PushMenu()
263-
* ==========
264-
* Adds the push menu functionality to the sidebar.
265-
*
266-
* @type Function
267-
* @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']")
268-
*/
269-
$.AdminLTE.pushMenu = {
270-
activate: function (toggleBtn) {
271-
//Get the screen sizes
272-
var screenSizes = $.AdminLTE.options.screenSizes;
273-
274-
//Enable sidebar toggle
275-
$(document).on('click', toggleBtn, function (e) {
276-
e.preventDefault();
277-
278-
//Enable sidebar push menu
279-
if ($(window).width() > (screenSizes.sm - 1)) {
280-
if ($("body").hasClass('sidebar-collapse')) {
281-
$("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu');
282-
} else {
283-
$("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu');
284-
}
285-
}
286-
//Handle sidebar push menu for small screens
287-
else {
288-
if ($("body").hasClass('sidebar-open')) {
289-
$("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu');
290-
} else {
291-
$("body").addClass('sidebar-open').trigger('expanded.pushMenu');
292-
}
293-
}
294-
});
295-
296-
$(".content-wrapper").click(function () {
297-
//Enable hide menu when clicking on the content-wrapper on small screens
298-
if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) {
299-
$("body").removeClass('sidebar-open');
300-
}
301-
});
302-
303-
//Enable expand on hover for sidebar mini
304-
if ($.AdminLTE.options.sidebarExpandOnHover
305-
|| ($('body').hasClass('fixed')
306-
&& $('body').hasClass('sidebar-mini'))) {
307-
this.expandOnHover();
308-
}
309-
},
310-
expandOnHover: function () {
311-
var _this = this;
312-
var screenWidth = $.AdminLTE.options.screenSizes.sm - 1;
313-
//Expand sidebar on hover
314-
$('.main-sidebar').hover(function () {
315-
if ($('body').hasClass('sidebar-mini')
316-
&& $("body").hasClass('sidebar-collapse')
317-
&& $(window).width() > screenWidth) {
318-
_this.expand();
319-
}
320-
}, function () {
321-
if ($('body').hasClass('sidebar-mini')
322-
&& $('body').hasClass('sidebar-expanded-on-hover')
323-
&& $(window).width() > screenWidth) {
324-
_this.collapse();
325-
}
326-
});
327-
},
328-
expand: function () {
329-
$("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover');
330-
},
331-
collapse: function () {
332-
if ($('body').hasClass('sidebar-expanded-on-hover')) {
333-
$('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse');
334-
}
335-
}
336-
};
337-
338253
/* Tree()
339254
* ======
340255
* Converts the sidebar into a multilevel
@@ -489,88 +404,4 @@ function _init() {
489404

490405
}
491406

492-
/* ------------------
493-
* - Custom Plugins -
494-
* ------------------
495-
* All custom plugins are defined below.
496-
*/
497-
498-
/*
499-
* BOX REFRESH BUTTON
500-
* ------------------
501-
* This is a custom plugin to use with the component BOX. It allows you to add
502-
* a refresh button to the box. It converts the box's state to a loading state.
503-
*
504-
* @type plugin
505-
* @usage $("#box-widget").boxRefresh( options );
506-
*/
507-
(function ($) {
508-
509-
"use strict";
510-
511-
$.fn.boxRefresh = function (options) {
512-
513-
// Render options
514-
var settings = $.extend({
515-
//Refresh button selector
516-
trigger: ".refresh-btn",
517-
//File source to be loaded (e.g: ajax/src.php)
518-
source: "",
519-
//Callbacks
520-
onLoadStart: function (box) {
521-
return box;
522-
}, //Right after the button has been clicked
523-
onLoadDone: function (box) {
524-
return box;
525-
} //When the source has been loaded
526-
527-
}, options);
528-
529-
//The overlay
530-
var overlay = $('<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>');
531-
532-
return this.each(function () {
533-
//if a source is specified
534-
if (settings.source === "") {
535-
if (window.console) {
536-
window.console.log("Please specify a source first - boxRefresh()");
537-
}
538-
return;
539-
}
540-
//the box
541-
var box = $(this);
542-
//the button
543-
var rBtn = box.find(settings.trigger).first();
544-
545-
//On trigger click
546-
rBtn.on('click', function (e) {
547-
e.preventDefault();
548-
//Add loading overlay
549-
start(box);
550-
551-
//Perform ajax call
552-
box.find(".box-body").load(settings.source, function () {
553-
done(box);
554-
});
555-
});
556-
});
557-
558-
function start(box) {
559-
//Add overlay and loading img
560-
box.append(overlay);
561-
562-
settings.onLoadStart.call(box);
563-
}
564-
565-
function done(box) {
566-
//Remove overlay and loading img
567-
box.find(overlay).remove();
568-
569-
settings.onLoadDone.call(box);
570-
}
571-
572-
};
573-
574407
})(jQuery);
575-
576-

0 commit comments

Comments
 (0)