From f91b0c8fd845828f6b2887d401f9b44c17325c40 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Sun, 1 Jan 2017 21:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=8A=9F=E8=83=BD=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=9B=BE=E6=A0=87=E4=BD=BF=E7=94=A8ajax=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E5=8A=A0=E8=BD=BD=EF=BC=8C=E9=98=B2=E6=AD=A2=E7=94=B1?= =?UTF-8?q?=E4=BA=8E=E7=BD=91=E9=80=9F=E6=85=A2=E5=AF=BC=E8=87=B4Menus?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=BE=88=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Content/css/fa.css | 9 +++++++ Bootstrap.Admin/Content/js/Longbow.Common.js | 2 ++ .../Controllers/AdminController.cs | 8 ++++++ Bootstrap.Admin/Scripts/Menus.js | 26 +++++++++++++------ Bootstrap.Admin/Views/Admin/Menus.cshtml | 2 +- 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Bootstrap.Admin/Content/css/fa.css b/Bootstrap.Admin/Content/css/fa.css index cf66acce..e065eb9a 100644 --- a/Bootstrap.Admin/Content/css/fa.css +++ b/Bootstrap.Admin/Content/css/fa.css @@ -105,6 +105,15 @@ height: inherit; } + .icon-content .modal-body .loadIconView { + text-align: center; + font-size: 16px; + } + + .icon-content .modal-body .loadIconView span { + margin-left: 6px; + } + .icon-content .modal-footer { position: fixed; left: 16px; diff --git a/Bootstrap.Admin/Content/js/Longbow.Common.js b/Bootstrap.Admin/Content/js/Longbow.Common.js index b9bf72b4..25e06333 100644 --- a/Bootstrap.Admin/Content/js/Longbow.Common.js +++ b/Bootstrap.Admin/Content/js/Longbow.Common.js @@ -135,6 +135,7 @@ url: data.url + data.Id, data: data.data, type: data.method, + async: true, success: function (result) { success(result); }, @@ -179,6 +180,7 @@ // Menus Menu = { url: '../api/Menus/', + iconView: '../Admin/IconView', title: "授权菜单" }; diff --git a/Bootstrap.Admin/Controllers/AdminController.cs b/Bootstrap.Admin/Controllers/AdminController.cs index 4b404456..540de91b 100644 --- a/Bootstrap.Admin/Controllers/AdminController.cs +++ b/Bootstrap.Admin/Controllers/AdminController.cs @@ -84,6 +84,14 @@ namespace Bootstrap.Admin.Controllers /// /// /// + public PartialViewResult IconView() + { + return PartialView("IconView"); + } + /// + /// + /// + /// public ActionResult Profiles() { var v = new NavigatorBarModel("~/Admin/Profiles"); diff --git a/Bootstrap.Admin/Scripts/Menus.js b/Bootstrap.Admin/Scripts/Menus.js index 5874a6ae..9437bf72 100644 --- a/Bootstrap.Admin/Scripts/Menus.js +++ b/Bootstrap.Admin/Scripts/Menus.js @@ -1,7 +1,6 @@ $(function () { var $dialog = $('#dialogNew'); var $pickIcon = $('#pickIcon'); - var $iconList = $('#iconTab').find('div.fontawesome-icon-list'); var $dialogNew = $dialog.find('div.modal-dialog'); var $dialogIcon = $('#dialogIcon'); var $dialogMenu = $('#dialogSubMenu').find('.modal-content'); @@ -137,13 +136,6 @@ } }); - $iconList.find('ul li').addClass('col-md-3 col-sm-4 col-xs-6'); - $iconList.find('div').addClass('col-xs-6'); - $iconList.on('click', 'div.fa-hover a, ul li', function () { - $pickIcon.attr('class', $(this).find('i, span:first').attr('class')); - return false; - }); - $btnPickIcon.on('click', function () { $dialogIcon.show(); }); @@ -233,4 +225,22 @@ $nestMenu.nestMenu(initNestMenu); // select $('.btn-select').select(); + + $.bc({ + url: Menu.iconView, + swal: false, + method: 'GET', + callback: function (result) { + if (result) { + $dialogIcon.find('.modal-body').html(result); + var $iconList = $('#iconTab').find('div.fontawesome-icon-list'); + $iconList.find('ul li').addClass('col-md-3 col-sm-4 col-xs-6'); + $iconList.find('div').addClass('col-xs-6'); + $iconList.on('click', 'div.fa-hover a, ul li', function () { + $pickIcon.attr('class', $(this).find('i, span:first').attr('class')); + return false; + }); + } + } + }); }); \ No newline at end of file diff --git a/Bootstrap.Admin/Views/Admin/Menus.cshtml b/Bootstrap.Admin/Views/Admin/Menus.cshtml index daf57b90..caee7a7e 100644 --- a/Bootstrap.Admin/Views/Admin/Menus.cshtml +++ b/Bootstrap.Admin/Views/Admin/Menus.cshtml @@ -153,7 +153,7 @@