Added option to enable expand sidebar on hover for sidebar mini

pull/360/head
Abdullah Almsaeed 2015-04-19 08:56:15 -04:00
parent 84ef3ce4da
commit d928b118df
1 changed files with 27 additions and 0 deletions

27
dist/js/demo.js vendored
View File

@ -75,6 +75,14 @@
+ "</label>" + "</label>"
+ "<p>Toggle the left sidebar's state (open or collapse)</p>" + "<p>Toggle the left sidebar's state (open or collapse)</p>"
+ "</div>" + "</div>"
//Sidebar mini expand on hover toggle
+ "<div class='form-group'>"
+ "<label class='control-sidebar-subheading'>"
+ "<input type='checkbox' data-enable='expandOnHover' class='pull-right'/> "
+ "Sidebar Expand on Hover"
+ "</label>"
+ "<p>Let the sidebar mini expand on hover</p>"
+ "</div>"
//Control Sidebar Toggle //Control Sidebar Toggle
+ "<div class='form-group'>" + "<div class='form-group'>"
+ "<label class='control-sidebar-subheading'>" + "<label class='control-sidebar-subheading'>"
@ -304,5 +312,24 @@
sidebar.addClass("control-sidebar-dark") sidebar.addClass("control-sidebar-dark")
} }
}); });
$("[data-enable='expandOnHover']").on('click', function () {
$(this).attr('disabled', true);
AdminLTE.pushMenu.expandOnHover();
if(!$('body').hasClass('sidebar-collapse'))
$("[data-layout='sidebar-collapse']").click();
});
// Reset options
if($('body').hasClass('fixed')) {
$("[data-layout='fixed']").attr('checked', 'checked');
}
if($('body').hasClass('layout-boxed')) {
$("[data-layout='layout-boxed']").attr('checked', 'checked');
}
if($('body').hasClass('sidebar-collapse')) {
$("[data-layout='sidebar-collapse']").attr('checked', 'checked');
}
} }
})(jQuery, $.AdminLTE); })(jQuery, $.AdminLTE);