后台表单提交方式
This commit is contained in:
@@ -169,19 +169,24 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){
|
||||
* @type Array
|
||||
*/
|
||||
mySkins: ['skin-blue', 'skin-black', 'skin-red', 'skin-yellow', 'skin-purple', 'skin-green', 'skin-blue-light', 'skin-black-light', 'skin-red-light', 'skin-yellow-light', 'skin-purple-light', 'skin-green-light'],
|
||||
|
||||
change_layout: function(cls){
|
||||
$("body").toggleClass(cls);
|
||||
AdminLTE.layout.fixSidebar();
|
||||
//Fix the problem with right sidebar and layout boxed
|
||||
if (cls == "layout-boxed")
|
||||
AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
|
||||
if ($('body').hasClass('fixed') && cls == 'fixed') {
|
||||
AdminLTE.pushMenu.expandOnHover();
|
||||
AdminLTE.layout.activate();
|
||||
|
||||
change_layout: function(){
|
||||
layout = sent.store.get({name: 'layout'}) || [{name: 'fixed', value: false}, {name: 'layout-boxed', value: false}, {name: 'sidebar-collapse', value: false}];
|
||||
if (typeof(layout) == 'string'){ return false; }
|
||||
for (i in layout) {
|
||||
var item = layout[i];
|
||||
if (item.value) {
|
||||
$("[data-layout='"+item.name+"']").attr('checked', 'checked');
|
||||
$("body").hasClass(item.name) || $("body").addClass(item.name);
|
||||
if ($('body').hasClass('fixed') && item.name == 'fixed') {
|
||||
AdminLTE.pushMenu.expandOnHover();
|
||||
AdminLTE.layout.activate();
|
||||
}
|
||||
}else{
|
||||
$("body").removeClass(item.name);
|
||||
}
|
||||
}
|
||||
AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
|
||||
AdminLTE.controlSidebar._fix($(".control-sidebar"));
|
||||
AdminLTE.layout.fixSidebar();
|
||||
},
|
||||
change_skin: function(cls){
|
||||
$.each(backend.mySkins, function (i) {
|
||||
@@ -193,9 +198,9 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){
|
||||
return false
|
||||
},
|
||||
init: function(){
|
||||
var tmp = sent.store.get({name:'skin'});
|
||||
if (tmp && $.inArray(tmp, backend.my_skins))
|
||||
backend.change_skin(tmp);
|
||||
var skin = sent.store.get({name:'skin'});
|
||||
if (skin && $.inArray(skin, backend.my_skins))
|
||||
backend.change_skin(skin);
|
||||
|
||||
//Add the change skin listener
|
||||
$("[data-skin]").on('click', function (e) {
|
||||
@@ -205,17 +210,15 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){
|
||||
backend.change_skin($(this).data('skin'));
|
||||
});
|
||||
|
||||
backend.change_layout();
|
||||
//Add the layout manager
|
||||
$("[data-layout]").on('click', function () {
|
||||
backend.change_layout($(this).data('layout'));
|
||||
});
|
||||
|
||||
$("[data-controlsidebar]").on('click', function () {
|
||||
backend.change_layout($(this).data('controlsidebar'));
|
||||
var slide = !AdminLTE.options.controlSidebarOptions.slide;
|
||||
AdminLTE.options.controlSidebarOptions.slide = slide;
|
||||
if (!slide)
|
||||
$('.control-sidebar').removeClass('control-sidebar-open');
|
||||
var layout = [];
|
||||
$("[data-layout]").each(function(i, item){
|
||||
layout.push({name:$(item).data('layout'), value: $(item).is(':checked')})
|
||||
})
|
||||
sent.store.set({name:'layout', content: layout});
|
||||
backend.change_layout();
|
||||
});
|
||||
|
||||
$("[data-sidebarskin='toggle']").on('click', function () {
|
||||
@@ -230,22 +233,11 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){
|
||||
});
|
||||
|
||||
$("[data-enable='expandOnHover']").on('click', function () {
|
||||
$(this).attr('disabled', true);
|
||||
AdminLTE.pushMenu.expandOnHover();
|
||||
if (!$('body').hasClass('sidebar-collapse'))
|
||||
$("[data-layout='sidebar-collapse']").click();
|
||||
$(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');
|
||||
}
|
||||
|
||||
if ($('.editable').size() > 0) {
|
||||
require(['bootstrap-editable'], function(){
|
||||
|
||||
Reference in New Issue
Block a user