From f83717e72415ec2ddb5c3468fbac83e35adba6c3 Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Wed, 12 Sep 2018 22:29:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=EF=BC=9AFA?= =?UTF-8?q?Icon=E9=A1=B5=E9=9D=A2=E4=BD=BF=E7=94=A8ajax=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=B1=80=E5=9F=9F=E8=A7=86=E5=9B=BE=EF=BC=8C?= =?UTF-8?q?=E5=88=A9=E7=94=A8=E5=B7=B2=E7=BB=8F=E8=A2=AB=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=E5=87=8F=E5=B0=91=E7=BD=91=E7=BB=9C=E5=B8=A6?= =?UTF-8?q?=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Views/Admin/FAIcon.cshtml | 2 +- Bootstrap.Admin/wwwroot/js/icon.js | 26 ++++++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Bootstrap.Admin/Views/Admin/FAIcon.cshtml b/Bootstrap.Admin/Views/Admin/FAIcon.cshtml index 962399a4..45defd3b 100644 --- a/Bootstrap.Admin/Views/Admin/FAIcon.cshtml +++ b/Bootstrap.Admin/Views/Admin/FAIcon.cshtml @@ -9,4 +9,4 @@ @section javascript { } -@await Html.PartialAsync("IconView") +
\ No newline at end of file diff --git a/Bootstrap.Admin/wwwroot/js/icon.js b/Bootstrap.Admin/wwwroot/js/icon.js index 8d1c80a9..568d5a17 100644 --- a/Bootstrap.Admin/wwwroot/js/icon.js +++ b/Bootstrap.Admin/wwwroot/js/icon.js @@ -1,11 +1,21 @@ $(function () { - var $iconList = $('div.fontawesome-icon-list').on('click', 'a', function () { - window.console.log($(this).children('i').attr('class')); - return false; + $.bc({ + url: Menu.iconView, + contentType: 'text/html', + dataType: 'html', + callback: function (result) { + if (result) { + $('#main-content').html(result); + var $iconList = $('div.fontawesome-icon-list').on('click', 'a', function () { + window.console.log($(this).children('i').attr('class')); + return false; + }); + + $iconList.find('ul li').addClass('col-xl-2 col-md-3 col-sm-4 col-6'); + $iconList.find('div').addClass('col-xl-2 col-6'); + + $('#main-content').scrollspy({ offset: 150, target: '.fa-nav' }); + } + } }); - - $iconList.find('ul li').addClass('col-xl-2 col-md-3 col-sm-4 col-6'); - $iconList.find('div').addClass('col-xl-2 col-6'); - - $('#main-content').scrollspy({ offset: 150, target: '.fa-nav' }); }); \ No newline at end of file