启用slimScroll美化滚动条

pull/71/head
PPPSCN 2018-04-10 07:05:50 +08:00
parent d84a277615
commit 180ce5c514
2 changed files with 17 additions and 4 deletions

View File

@ -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;
} }

View File

@ -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) {