feat: 增加 lgbinfo 组件

#Comment
网站设置 Blazor 开关更新为 lgbinfo 组件
This commit is contained in:
Argo-2016 2020-01-19 16:36:59 +08:00
parent be80b0c629
commit 98b8eac888
3 changed files with 12 additions and 9 deletions

View File

@ -177,7 +177,7 @@
<div class="form-inline">
<div class="row">
<div class="form-group col-6">
<label class="control-label" for="blazor">Blazor</label>
<label class="control-label" for="blazor">MVC 切换</label>
<Toggle @bind-Value="@Model.EnableBlazor" OnText="开启" OffText="关闭"></Toggle>
</div>
</div>

View File

@ -169,13 +169,10 @@
<div class="card" asp-auth="blazor">
<div class="card-header">网站设置</div>
<div class="card-body">
<div class="alert alert-info" role="alert">
<span>开启此功能网站增加 Blazor 与 MVC 切换挂件</span>
</div>
<div class="form-inline">
<div class="row">
<div class="form-group col-6">
<label class="control-label" for="blazor">Blazor</label>
<label class="control-label" data-toggle="lgbinfo" data-content="开启此功能网站增加 Blazor 与 MVC 切换挂件" for="blazor">Blazor 切换</label>
<input id="blazor" hidden type="checkbox" data-default-val="@Model.EnableBlazor" data-toggle="toggle" data-width="120" data-onstyle="success" data-on="开启" data-off="关闭" />
</div>
</div>

View File

@ -622,15 +622,21 @@
lgbInfo: function (option) {
this.each(function () {
var $element = $(this);
$element.append($.format('<a href="#" tabindex="-1" role="button" data-toggle="popover"><i class="fa fa-question-circle"></i></a>'));
$element.append($('<a href="#" tabindex="-1" role="button" data-toggle="popover"><i class="fa fa-question-circle"></i></a>'));
});
var container = this.attr('data-container') || '#dialogNew';
var container = this.attr('data-container') || 'body';
this.find('[data-toggle="popover"]').popover($.extend({
title: function () {
return $(this).parent().text();
}, content: function () {
},
content: function () {
return $(this).parent().attr('data-content');
}, trigger: 'focus', html: true, container: container, placement: function () {
},
trigger: 'focus',
html: false,
sanitize: true,
container: container,
placement: function () {
return $(this.element).parent().attr('data-placement') || 'auto';
}
}, option));