采用slimScroll美化滚动条

pull/98/head
PPPSCN 2019-02-16 18:00:50 +08:00
parent 779f5d63ef
commit aac15b1565
1 changed files with 14 additions and 3 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 = {
config: {
//toastr默认配置
@ -6,7 +6,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
"closeButton": true,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"progressBar": true,
"positionClass": "toast-top-center",
"preventDuplicates": false,
"onclick": null,
@ -114,7 +114,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
},
//打开一个弹出窗口
open: function (url, title, options) {
title = title ? title : "";
title = options.title ? options.title : (title ? title : "");
url = Fast.api.fixurl(url);
url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
var area = [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
@ -315,6 +315,17 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
});
//公共代码
$(function ($) {
if (self === top) {
$('div[role="main"]').slimScroll({height: $(window).height() + 'px'});
} else {
var ScrollHeight = $('iframe', parent.document).height();
if (!ScrollHeight || ScrollHeight === 100) {
ScrollHeight = $('.content-wrapper', parent.document).height();
}
$('div[role="main"]').slimScroll({height: ScrollHeight + 'px'});
}
});
//配置Toastr的参数
Toastr.options = Fast.config.toastr;
}