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 = {
|
||||
config: {
|
||||
//toastr默认配置
|
||||
|
|
@ -105,7 +105,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
|
|||
}
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
||||
results = regex.exec(url);
|
||||
results = regex.exec(url);
|
||||
if (!results)
|
||||
return null;
|
||||
if (!results[2])
|
||||
|
|
@ -232,8 +232,8 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
|
|||
},
|
||||
lang: function () {
|
||||
var args = arguments,
|
||||
string = args[0],
|
||||
i = 1;
|
||||
string = args[0],
|
||||
i = 1;
|
||||
string = string.toLowerCase();
|
||||
//string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
|
||||
if (typeof Lang[string] != 'undefined') {
|
||||
|
|
@ -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.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) {
|
||||
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.disabledbtn, toolbar).toggleClass('disabled', true);
|
||||
if ($(Table.config.firsttd, table).find("input[type='checkbox'][data-index]").size() > 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue