mirror of https://gitee.com/karson/fastadmin.git
启用slimScroll美化滚动条
parent
d84a277615
commit
180ce5c514
|
|
@ -1,4 +1,4 @@
|
||||||
define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefined, Toastr, Layer, Lang) {
|
define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'slimscroll'], function ($, undefined, Toastr, Layer, Lang, slimScroll) {
|
||||||
var Fast = {
|
var Fast = {
|
||||||
config: {
|
config: {
|
||||||
//toastr默认配置
|
//toastr默认配置
|
||||||
|
|
@ -301,6 +301,16 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
|
||||||
});
|
});
|
||||||
|
|
||||||
//公共代码
|
//公共代码
|
||||||
|
$(function ($) {
|
||||||
|
if (self === top) {
|
||||||
|
$('#main').slimScroll({height: $(window).height() + 'px'});
|
||||||
|
} else {
|
||||||
|
var ScrollHeight = $('iframe', parent.document).height();
|
||||||
|
if (ScrollHeight) {
|
||||||
|
$('#main').slimScroll({height: ScrollHeight + 'px'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
//配置Toastr的参数
|
//配置Toastr的参数
|
||||||
Toastr.options = Fast.config.toastr;
|
Toastr.options = Fast.config.toastr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,9 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
});
|
});
|
||||||
//当内容渲染完成后
|
//当内容渲染完成后
|
||||||
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
||||||
|
var ScrollHeight = self == top ? $(window).height() : $('.content-wrapper', parent.document).height();
|
||||||
|
table.closest('#main').height(ScrollHeight);
|
||||||
|
table.closest('.slimScrollDiv').height(ScrollHeight);
|
||||||
$(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin");
|
$(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin");
|
||||||
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', true);
|
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', true);
|
||||||
if ($(Table.config.firsttd, table).find("input[type='checkbox'][data-index]").size() > 0) {
|
if ($(Table.config.firsttd, table).find("input[type='checkbox'][data-index]").size() > 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue