From aac15b15653698f01902836e0560418606f85c58 Mon Sep 17 00:00:00 2001 From: PPPSCN <35696959@qq.com> Date: Sat, 16 Feb 2019 18:00:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E7=94=A8slimScroll=E7=BE=8E=E5=8C=96?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/fast.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/public/assets/js/fast.js b/public/assets/js/fast.js index aad06de2..8469695a 100644 --- a/public/assets/js/fast.js +++ b/public/assets/js/fast.js @@ -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; }