From b394677a5000f86f3999471f91e3eb5487e526e2 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Thu, 11 Oct 2018 22:36:53 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=9B=B4=E6=94=B9=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/js/halo.js | 55 ++++++++++--------- .../common/macro/theme_option_marco.ftl | 39 ++++++++++++- 2 files changed, 66 insertions(+), 28 deletions(-) diff --git a/src/main/resources/static/js/halo.js b/src/main/resources/static/js/halo.js index 0e4f3a3fa..dcdfafaeb 100755 --- a/src/main/resources/static/js/halo.js +++ b/src/main/resources/static/js/halo.js @@ -75,31 +75,6 @@ function initMenu() { }); } -/** - * 提示框 - * @param text - * @param icon - * @param hideAfter - */ -function showMsg(text, icon, hideAfter) { - if(heading==undefined){ - var heading = "提示"; - } - $.toast({ - text: text, - heading: heading, - icon: icon, - showHideTransition: 'fade', - allowToastClose: true, - hideAfter: hideAfter, - stack: 1, - position: 'top-center', - textAlign: 'left', - loader: true, - loaderBg: '#ffffff' - }); -} - /** * 普通提示框 * @@ -185,6 +160,36 @@ $.halo.prototype.showMsgAndRedirect = function (text, icon, hideAfter, url) { }); }; +/** + * 提示之后 父页面重定向 + * @param text text + * @param icon icon + * @param hideAfter hideAfter + * @param url url + */ +$.halo.prototype.showMsgAndParentRedirect = function (text, icon, hideAfter, url) { + if (heading == undefined) { + var heading = "提示"; + } + $.toast({ + text: text, + heading: heading, + icon: icon, + showHideTransition: 'fade', + allowToastClose: true, + hideAfter: hideAfter, + stack: 1, + position: 'top-center', + textAlign: 'left', + loader: true, + loaderBg: '#ffffff', + afterHidden: function () { + parent.location.href = url; + } + }); +}; + + /** * 格式化字符串 * diff --git a/src/main/resources/templates/common/macro/theme_option_marco.ftl b/src/main/resources/templates/common/macro/theme_option_marco.ftl index 131cc910d..a0741fd2f 100644 --- a/src/main/resources/templates/common/macro/theme_option_marco.ftl +++ b/src/main/resources/templates/common/macro/theme_option_marco.ftl @@ -31,6 +31,12 @@ <#nested />